Print
카테고리: [ Apache Tomcat ]
조회수: 3961

60117: Ensure that the name of LogLevel is localized when using OneLineFormatter. Patch provided by Tatsuya Bessho. (kfujino)

대상 버전 : 8.0.38 ~ 등

 

export CATALINA_OPTS="$CATALINA_OPTS -Duser.language=ko"

위와 같이 System Property를 통해 user.language를 ko로 설정한 후 Tomcat 8.0.37을 기동해 보겠습니다.

17-Oct-2016 17:46:39.616 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/docs
17-Oct-2016 17:46:39.730 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/docs has finished in 114 ms
17-Oct-2016 17:46:39.731 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/ROOT
17-Oct-2016 17:46:39.836 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/ROOT has finished in 105 ms
17-Oct-2016 17:46:39.836 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/manager
17-Oct-2016 17:46:39.900 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/manager has finished in 64 ms
17-Oct-2016 17:46:39.900 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/examples
17-Oct-2016 17:46:40.665 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.37/webapps/examples has finished in 765 ms
17-Oct-2016 17:46:40.689 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
17-Oct-2016 17:46:40.709 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 3765 ms

 "INFO" 등과 같이 여전히 영어로 표시됩니다.

이번에는 동일하게 설정 후 Tomca 8.0.38을 기동해 보겠습니다.

17-Oct-2016 17:47:30.457 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/docs
17-Oct-2016 17:47:30.517 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/docs has finished in 60 ms
17-Oct-2016 17:47:30.518 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/ROOT
17-Oct-2016 17:47:30.571 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/ROOT has finished in 53 ms
17-Oct-2016 17:47:30.571 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/manager
17-Oct-2016 17:47:30.639 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/manager has finished in 68 ms
17-Oct-2016 17:47:30.640 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/examples
17-Oct-2016 17:47:31.587 정보 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /engn001/tomcat/apache-tomcat-8.0.38/webapps/examples has finished in 947 ms
17-Oct-2016 17:47:31.594 정보 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
17-Oct-2016 17:47:31.605 정보 [main] org.apache.catalina.startup.Catalina.start Server startup in 2114 ms

 "정보"라고 한글로 나옵니다! 어떻게 된걸까요.

org.apache.juli.OneLineFormatter 클래스 확인해 보겠습니다.

먼저 8.0.37입니다.

    101         // Severity
    102         sb.append(' ');
    103         sb.append(record.getLevel());

이번에는 8.0.38입니다.

    101         // Severity
    102         sb.append(' ');
    103         sb.append(record.getLevel().getLocalizedName());