-
1. Re: jboss configuration
peterj Nov 26, 2014 10:06 AM (in response to mundi)1 of 1 people found this helpfulThere is no way for the logger to know the name of the deployed application responsible for this log entry. The best you can do (and what has worked well for me) is to look at the thread name and follow it through the log. Provided that the deployed application does some of its own logging, you should be able to determine which common class log entries go with which application. In my case, I make a log entry when a request comes in and another when I reply, making it easy to track individual requests. Just be aware that threads are pooled and reused, so the same thread will not always handle requests for the same application; but a single thread will handle an entire request.
-
2. Re: jboss configuration
mundi Dec 1, 2014 10:55 AM (in response to mundi)I solved my issue by using one log file per deployement by using this jboss-logging.properties file:
# Root logger level
logger.level=INFO
# Root logger handlers
logger.useParentHandlers=true
logger.handlers=APPFILE,SERVERFILE,CONSOLE
# Console handler configuration
handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.properties=autoFlush
handler.CONSOLE.level=INFO
handler.CONSOLE.autoFlush=true
handler.CONSOLE.formatter=PATTERN
# File handler configuration
handler.APPFILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.APPFILE.properties=autoFlush,append,fileName,suffix,enabled
handler.APPFILE.constructorProperties=fileName,append
handler.APPFILE.suffix=.yyyy-MM-dd
handler.APPFILE.append=true
handler.APPFILE.autoFlush=true
handler.APPFILE.fileName=${jboss.server.log.dir}/${project.artifactId}/${project.artifactId}-wildfly-${classifier}.log
handler.APPFILE.formatter=PATTERN
handler.APPFILE.enabled=true
# File handler configuration
handler.SERVERFILE=org.jboss.logmanager.handlers.PeriodicRotatingFileHandler
handler.SERVERFILE.properties=autoFlush,append,fileName,suffix,enabled
handler.SERVERFILE.constructorProperties=fileName,append
handler.SERVERFILE.suffix=.yyyy-MM-dd
handler.SERVERFILE.append=true
handler.SERVERFILE.autoFlush=true
handler.SERVERFILE.fileName=${jboss.server.log.dir}/server.log
handler.SERVERFILE.formatter=PATTERN
handler.SERVERFILE.enabled=true
# Formatter pattern configuration
formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%nIt writes my logging to the default "server.log" file, the console and in addition to a logging file [programmname].log.
But unfortunately a new problem appeared: Every day the log should be renamed as [logfile].log.%yyyy-MM-dd and a new log should be started.
This is done for my [application].log log file but the server.log is not renamed.
Is my configuration file fauly?
-
3. Re: jboss configuration
ksreen Dec 10, 2014 11:39 PM (in response to mundi)You can try the method suggested in this blog http://blog.jyore.com/?p=234
-
4. Re: jboss configuration
jamezp Dec 12, 2014 6:23 PM (in response to mundi)You could use an MDC entry. You'd just need to add something like %X{appName} to the pattern and ensure the appName is set in MDC.
--
James R. Perkins