AppFuse 는, 직접 다운로드 받는게 아니라, Maven 을 통해 받아와야 한다.
이를 위해서는 Maven 을 받아서 설치해야 하는데, 받는 김에 Eclipse 용 Maven 플러그인(m2eclipse) 을 설치하려고, 하는데, Install & Update 에서, install.. 하면, equinox 어쩌구 하고 에러가 뜬다.

 이건, 내가 Maven 설치 시에, 옵셔널한 놈들도 설치하려고 해서 그런것이고, AJDT 관련 옵션을 설치하려 해서 그렇다. 에러 없이 진행하려면, AspectJ Development Tool 을 먼저 Eclipse 에 받으면 된다.
 관련 URL 은, http://docs.codehaus.org/display/M2ECLIPSE/Installation+Requirements 에 보면 설명중에 AJDT(Optional) 부분에, Eclipse Update URL 이 나와 있다.
 현재 3.4 용은  http://download.eclipse.org/tools/ajdt/34/update 에서 받으면 된단다.
반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,

 프로젝트 중에, JEUS 를 사용하는데 (제우스6), JSP 나 Action 은 모두 Response Header 에, Content-Type 이 UTF-8 로 잘 넘어오지만, 유독 JS 파일을 받을 때, euc-kr 로 넘어오더라. 

 JEUS 에서, 기본적으로, Encoding 정보가 별도로 없으면, euc-kr 로 넘기는 듯 싶다. Jeus 6 의 경우, WEBMain.xml 에서, 기본 인코딩 정보를 아래와 같이 설정해주면 된다.
<context-group>
...
<encoding>
        <request-url-encoding>
                <default>UTF-8</default>
        </request-url-encoding>
        <request-encoding>
                <default>UTF-8</default>
        </request-encoding>
        <response-encoding>
                <default>UTF-8</default>
        </response-encoding>
</encoding>
...
</context-group>



또, 아래 정보는 어디서 퍼온 것인데, JavaScript 별로, charset 을 지정해 줄 수 있다.

International Language Support in JavaScript

JavaScript is built to support a wide variety of world languages andtheir characters – from the old US ASCII up to the rapidly spreadingUTF-8. This page clears up some of the difficulties encountered whendealing with multiple languages and their related characters.

JavaScript and Character Sets

When working with non-European character sets ("charsets"), you mayneed to make changes to the way your page references externalJavaScript(.js) files. Ideally, your .js files should saved in theUTF-8 character set in order to maximize its multilingual features —though you can use a different charset that supports your language, atthe potential expense of users who can't support it. Once your filesare saved as UTF-8, they must be "served" in the UTF-8 charset in orderto display correctly. There are a few ways to ensure this:

Serve the Web Page as UTF-8

If your page is already served as UTF-8 (i.e. Content-type=text/html; charset=UTF-8),you don't need to make any changes — all embedded files in an HTMLdocument are served in the same charset as the document, unlessexplicitly specified not to by you. You can do this by:

  • Use the Content-type meta tag — place at the TOP of your page's <head> section.

    <meta name="http-equiv" content="Content-type: text/html; charset=UTF-8"/>)
  • Edit your webserver configuration to serve all documents as UTF-8
  • Send the Content-type header via your server-side scripts (i.e. PHP, ASP, JSP)

Use the charset attribute of the <script> tag

The easiest way to ensure your script is served as UTF-8 is to add acharset attribute (charset="utf-8") to your <script> tags in theparent page:

<script type="text/javascript" src="[path]/myscript.js" charset="utf-8"></script>

Modify your .htaccess files (Apache Only)

You can also configure your webserver to serve all .js files in theUTF-8 charset, or only .js files in a single directory. You can do thelatter (in Apache) by adding this line to the .htaccess file in the directory where your scripts are stored:

AddCharset utf-8 .js
반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,



1. Prologue

 JAVA 개발하면서, log4j 를 모르는 사람은 없을듯 하다. 그만큼 오래전부터 사용 해 왔고, 성능또한 검증이 되었고, 사용법도 그리 어렵지 않아서인 듯 하다. 실제로 많은 오픈소스 프레임웍이나 라이브러리에서, log4j 에 dependency 를 걸고 있는 것만 보아도 그렇다.

 사내 프레임워크의 경우, log4j 를 사용하지는 않지만, Concept 을 다소 가져다가 쓰는 부분들이 있다. 하지만 사실 설정이나 사용 편의성, 기능의 확장성 등의 측면에서, 사내 프레임웍이 조금은 나은 듯 하기도 하다. Log4J 는 Inherit 개념으로 인해 살짝 불필요한 고민을 아키텍트나 개발자가 하게 만드는 것 같다.

 뭐 아직 많이 사용해보지는 않았으니, 내가 잘 모르는 뭔가가 있을수도..

 이번 Log4J 를 분석해가면서 한가지 원칙을 정한게 있다. "책은 안본다" 라는 원칙인데, 공부하기 싫다는건 아니고, 오픈소스 라이브러리들이 대부분 보면, Help 가 빈약하다는 느낌이다. 이것저것 쓰다보면, 안그래도 좋지않은 머리가 사용법을 다 기억하고 있는것도 아니고, Help 를 봐가면서 작업해야 하는데, MSDN 처럼 정리된 Help 가 있는것도 아니라서 난감할 때가 한두번이 아니다.

 책을 보면, 참 친절하게 설명하고는 있으나, 책 보면서 하려면, 책 없으면 못한다라는 결론이 내려져서, 이번부터는 책 없이 해보려 한다. 그래서, 여기저기를 뒤져가면서 (아 왜 지들이 만들고 사용법은 신경을 안서 그랴..) 나만의 사용법 등을 정리 해 나가기로 했다.

2. 설치 및 관련 파일

 log4j 는 apache 의 logging 프로젝트로 들어가면 된다. logging.apache.org 들어가면, log4j, log4cxx, log4net 등이 있고, 현재는 log4php 가 incubation 상태이다.

  log4j 1.2 버전을 받고 (1.3은 중단됐고, 2.0은 실험용이란다), 압축을 푼다. 현재 최신 버전은 1.2.15 버전이다.
요놈을 받아서 풀면, 아래와 같은 디렉토리 나오겠다.


- contribs 에는, 개발한 애들의 이름 밑에, 갸들의 샘플 코드들이 있고 (나중에 시간나면 뭔 코든지나 좀 살펴봐야 할듯)
- examples 에는, 샘플이 있긴 한데, 정말 별 쓰잘떼기 없는 샘플들이다. 특히, 난 lf5 밑에 있는 코드들이 예시를 든 잘된 코드구나.. 생각했드니만, 죄다 log force 5 라는 로그 보여주는, 패키지 내의 툴을 띄워서 보여줄 목적으로 만든 코드들이다.
- site 는, 지들 사이트의 문서들을 offline 에서 볼수있도록 해놓은 것들이고. (introduction 과 API 만 볼만함)
- src 는 log4j 의 소스코드
- tests 는 지들의 log4j 라이브러리 테스트 코드들을 넣어놨다. 그런데, 대부분의 properties 및 XML 설정파일들이 여기에 가지별로 있다. 하지만, XML 내에 어떤 element 가 어떤것인지는 안써있다는거~

나머지 뭐 빌드하고 자시고 할 것 없이, Eclipse 에 프로젝트 만들어서 Sample 몇개 돌려보면 될것이다. 어차피 샘플로 얻어지는 것은 별로 없더라는..

이노무 Ceki Gulcu 라는 놈이, 지 책 팔아먹을라고 제대로 된 매뉴얼은 책으로 만들어놓은듯..

3. Log4J 의 핵심 개념 몇가지

(1) Logger
 

(2) Appender

(3) Layout



반응형
블로그 이미지

Good Joon

IT Professionalist Since 1999

,