Reputation: 1046
My war myApp
is deployed into wildfly 10.
myApp has its own 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 has default standalone configuration
Root Logger
CONSOLE FILE
INFO
Handler CONSOLE
INFO
%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n
System.out
Handler FILE (Periodic)
ALL
%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%e%n
In Wildfly console i can see logs generated from 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)
But i cant find them in 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)
Why ?
Upvotes: 0
Views: 899
Reputation: 1
Your logging is being handled by the ConsoleAppender configured in your app, not the server log configuration. We had same issue with an application which also had it's own logging configuration. Since it's the only application on the server, we forced the application to use the (extended for our app) server logging configuration. In standalone*.xml file, add at top of xmlns="urn:jboss:domain:logging:3.0" stanza:
<use-deployment-logging-config value="false"/>
Upvotes: 0
Reputation: 1188
You have used ConsoleAppender. It is used to print logging information to a console. If you need logging in file, use FileAppender.
Upvotes: 3