Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1367 change log4j-1.2.17 to log4j-2.17.1 #1380

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 14 additions & 9 deletions documentation/manual/logs.textile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
h1. Logging configuration

The Play logger is built on "Log4j":http://logging.apache.org/log4j/1.2/index.html. Since most Java libraries use Log4j or a wrapper able to use Log4j as a backend, you can easily configure logging that is well-suited to your application.
The Play logger is built on "Log4j":https://logging.apache.org/log4j/2.x. Since most Java libraries use Log4j or a wrapper able to use Log4j as a backend, you can easily configure logging that is well-suited to your application.


h2. <a name="logging">Logging from your application</a>
Expand Down Expand Up @@ -30,14 +30,19 @@ If you need to fully configure Log4j, create a @log4j.properties@ file in the @c

The default Log4j configuration is the following:

bc. log4j.rootLogger=ERROR, Console

log4j.logger.play=INFO

# Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p ~ %m%n
bc. # appender Console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
# root logger
rootLogger.level = INFO
rootLogger.appenderRef.console.ref = STDOUT

Copy this file and update it for your specifics needs!

Expand Down
31 changes: 20 additions & 11 deletions documentation/manual/production.textile
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,26 @@ For production it’s a good idea to use rolling log files. Do not send logging

Create a custom @log4j.properties@ in the @conf/@ directory:

bc. log4j.rootLogger=ERROR, Rolling

log4j.logger.play=INFO

# Rolling files
log4j.appender.Rolling=org.apache.log4j.RollingFileAppender
log4j.appender.Rolling.File=application.log
log4j.appender.Rolling.MaxFileSize=1MB
log4j.appender.Rolling.MaxBackupIndex=100
log4j.appender.Rolling.layout=org.apache.log4j.PatternLayout
log4j.appender.Rolling.layout.ConversionPattern=%d{ABSOLUTE} %-5p ~ %m%n
bc. # appender Console
appender.fileLogger.type = RollingFile
appender.fileLogger.name = fileLogger
appender.fileLogger.fileName= logs/application.log
appender.fileLogger.filePattern= logs/application%i.log
appender.fileLogger.layout.type = PatternLayout
appender.fileLogger.layout.pattern = %d [%t] %p %c - %m%n
appender.fileLogger.policies.type = Policies
appender.fileLogger.policies.size.type = SizeBasedTriggeringPolicy
appender.fileLogger.policies.size.size = 1MB
appender.fileLogger.strategy.type = DefaultRolloverStrategy
appender.fileLogger.strategy.max = 100
appender.fileLogger.filter.threshold.type = ThresholdFilter
appender.fileLogger.filter.threshold.level = ERROR
# play logger
logger.app.name = play
logger.app.level = ERROR
# root logger
rootLogger.level = ERROR
rootLogger.appenderRef.fileLogger.ref = fileLogger

h2. <a name="server">Front-end HTTP server</a>

Expand Down
2 changes: 1 addition & 1 deletion documentation/manual_ja/logs.textile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
h1. ログの設定

Play のロガーは組み込みの "Log4j":http://logging.apache.org/log4j/1.2/index.html です。ほとんどの Java ライブラリが Log4j か、または Log4j をバックエンドとして使えるラッパを使用するので、アプリケーションに適合するよう、容易にロギングを設定することができます。
Play のロガーは組み込みの "Log4j":https://logging.apache.org/log4j/2.x/ です。ほとんどの Java ライブラリが Log4j か、または Log4j をバックエンドとして使えるラッパを使用するので、アプリケーションに適合するよう、容易にロギングを設定することができます。

h2. <a name="logging">アプリケーションからのロギング</a>

Expand Down
17 changes: 9 additions & 8 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require: &allDependencies
- com.google.code.gson -> gson 2.8.9
- com.jamonapi -> jamon 2.82
- com.ning -> async-http-client 1.9.40
- commons-beanutils 1.9.4
- commons-beanutils 1.9.4
- commons-codec 1.15
- org.apache.commons -> commons-email 1.5
- commons-fileupload 1.4
Expand All @@ -38,7 +38,8 @@ require: &allDependencies
- org.hamcrest -> hamcrest-all 1.3
- junit 4.13.2
- jregex 1.2_01
- log4j 1.2.17
- log4j-api 2.17.1
- log4j-core 2.17.1
- net.sf.ehcache -> ehcache 2.10.9.2
- net.sf.ezmorph -> ezmorph 1.0.6
- net.sf.jsr107cache -> jsr107cache 1.1
Expand Down Expand Up @@ -70,7 +71,7 @@ require: &allDependencies
- io.netty -> netty 3.10.6.Final
- org.postgresql -> postgresql 42.3.1
- org.slf4j -> slf4j-api 1.7.33
- org.slf4j -> slf4j-log4j12 1.7.33
- org.apache.logging.log4j -> log4j-slf4j-impl 2.17.1
- org.yaml -> snakeyaml 1.30
- net.spy -> spymemcached 2.12.3
- com.thoughtworks.xstream -> xstream 1.4.19
Expand All @@ -90,7 +91,7 @@ repositories:
type: local
artifact: "${play.path}/framework/lib/[artifact]-[revision].jar"
contains: *allDependencies

- playCoreCrud:
type: local
artifact: "${play.path}/modules/crud"
Expand All @@ -102,16 +103,16 @@ repositories:
artifact: "${play.path}/modules/secure"
contains:
- play -> secure $version

- playCoreDocviewer:
type: local
artifact: "${play.path}/modules/docviewer"
contains:
- play -> docviewer $version

- playModules:
- playModules:
type: chain
using:
using:
- playLocalModules:
type: local
descriptor: "${play.path}/modules/[module]-[revision]/conf/dependencies.yml"
Expand All @@ -121,7 +122,7 @@ repositories:
type: http
descriptor: "https://www.playframework.com/modules/repo/[module]/[revision]/dependencies.yml"
artifact: "https://www.playframework.com/modules/[module]-[revision].zip"

contains:
- play -> *

Expand Down
Binary file removed framework/lib/log4j-1.2.17.jar
Binary file not shown.
Binary file added framework/lib/log4j-api-2.17.1.jar
Binary file not shown.
Binary file added framework/lib/log4j-core-2.17.1.jar
Binary file not shown.
Binary file added framework/lib/log4j-slf4j-impl-2.17.1.jar
Binary file not shown.
Binary file removed framework/lib/slf4j-log4j12-1.7.33.jar
Binary file not shown.
49 changes: 27 additions & 22 deletions framework/src/log4j.properties
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
log4j.rootLogger=INFO, Console
# appender Console
appender.console.type = Console
appender.console.name = ConsoleName
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
logger.quartz.level=WARN
logger.quartz.level.name=logger.org.quartz
logger.hibernate.level=WARN
logger.hibernate.level.name=logger.org.hibernate
logger.DataNucleus.level=WARN
logger.DataNucleus.level.name=logger.DataNucleus
logger.httpclient.level=ERROR
logger.httpclient.level.name=logger.org.apache.commons.httpclient=
logger.internal.level=ERROR
logger.internal.level.name=logger.net.sf.oval.internal=
logger.springframework.level=WARN
logger.springframework.level.name=logger.org.springframework
logger.mchange.level=WARN
logger.mchange.level.name=logger.com.mchange

log4j.logger.play=INFO
log4j.logger.org.quartz=WARN
log4j.logger.org.hibernate=WARN
log4j.logger.DataNucleus=WARN
log4j.logger.org.apache.commons.httpclient=ERROR
log4j.logger.net.sf.oval.internal=ERROR
log4j.logger.org.springframework=WARN
log4j.logger.com.mchange=WARN

# Console
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout
log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p ~ %m%n

# Rolling files
# log4j.appender.Rolling=org.apache.log4j.RollingFileAppender
# log4j.appender.Rolling.File=${application.path}/logs/application.log
# log4j.appender.Rolling.MaxFileSize=1MB
# log4j.appender.Rolling.MaxBackupIndex=100
# log4j.appender.Rolling.layout=org.apache.log4j.PatternLayout
# log4j.appender.Rolling.layout.ConversionPattern=%d{DATE} %-5p ~ %m%n
# root logger
rootLogger.level = INFO
rootLogger.appenderRef.console.ref = ConsoleName
Loading