0
我的戰爭myApp
被部署到wildfly 10Wildfly 10不寫日誌,定期處理
對myApp都有自己的log4j.properties:
log4j.rootLogger=DEBUG, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d - myApp: %m %n
Wildfly具有默認的獨立配置
根記錄
- 處理程序:
CONSOLE FILE
- 等級:
INFO
處理程序CONSOLE
- 程度:
INFO
- 圖樣:
%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n
- 目標:
System.out
處理程序文件(週期)
- 等級:
ALL
- 模式:
%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n
在Wildfly控制檯我可以看到從對myApp生成的日誌:
12:58:43,480 INFO [io.undertow.servlet] (ServerService Thread Pool -- 65) 2 Spring WebApplicationInitializers detected on classpath
12:58:43,521 INFO [io.undertow.servlet] (ServerService Thread Pool -- 63) 2 Spring WebApplicationInitializers detected on classpath
2017-05-08 12:58:44,337 - myApp:
2017-05-08 12:58:44,353 - myApp: . ____ _ __ _ _
2017-05-08 12:58:44,353 - myApp: /\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
2017-05-08 12:58:44,353 - myApp: (()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
2017-05-08 12:58:44,354 - myApp: \\/ ___)| |_)| | | | | || (_| | ))))
2017-05-08 12:58:44,354 - myApp: ' |____| .__|_| |_|_| |_\__, |////
2017-05-08 12:58:44,354 - myApp: =========|_|==============|___/=/_/_/_/
2017-05-08 12:58:44,360 - myApp: :: Spring Boot :: (v1.4.1.RELEASE)
2017-05-08 12:58:44,361 - myApp:
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65)
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) . ____ _ __ _ _
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) /\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) (()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) \\/ ___)| |_)| | | | | || (_| | ))))
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) ' |____| .__|_| |_|_| |_\__, |////
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) =========|_|==============|___/=/_/_/_/
12:58:44,375 INFO [stdout] (ServerService Thread Pool -- 65) :: Spring Boot :: (v1.4.3.RELEASE)
12:58:44,375 INFO [stdout] (ServerService Thread Pool -- 65)
,但我不能在server.log中找到他們:
12:58:43,480 INFO [io.undertow.servlet] (ServerService Thread Pool -- 65) 2 Spring WebApplicationInitializers detected on classpath
12:58:43,521 INFO [io.undertow.servlet] (ServerService Thread Pool -- 63) 2 Spring WebApplicationInitializers detected on classpath
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65)
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) . ____ _ __ _ _
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) /\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \
12:58:44,366 INFO [stdout] (ServerService Thread Pool -- 65) (()\___ | '_ | '_| | '_ \/ _` | \ \ \ \
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) \\/ ___)| |_)| | | | | || (_| | ))))
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) ' |____| .__|_| |_|_| |_\__, |////
12:58:44,367 INFO [stdout] (ServerService Thread Pool -- 65) =========|_|==============|___/=/_/_/_/
12:58:44,375 INFO [stdout] (ServerService Thread Pool -- 65) :: Spring Boot :: (v1.4.3.RELEASE)
12:58:44,375 INFO [stdout] (ServerService Thread Pool -- 65)
爲什麼?
要在使用自己的日誌記錄配置進行部署時添加到此項,它不會使用日誌子系統配置。它有一個新的上下文用來確定它的日誌配置。 –