Jboss/Wildfly Logging to Separate Files -
we have deployed 2 ears both same package file structure. possible wildfly log info 2 separate log files whereby each ear has own logging information? if so, how configure in config file?
yes possible log information on separate files in wildlfy. need define multiple logging profiles on wildfly configuration file.
create new logger profile either using jboss cli or directly updating standalone.xml file.
open standalone.xml file , update following section,
<subsystem xmlns="urn:jboss:domain:logging:3.0">
and update section like,
<logging-profiles> <logging-profile name="accounts-app-profile"> <console-handler name="console"> <level name="info"/> <formatter> <named-formatter name="color-pattern"/> </formatter> </console-handler> <periodic-rotating-file-handler name="file" autoflush="true"> <formatter> <named-formatter name="pattern"/> </formatter> <file relative-to="jboss.server.log.dir" path="server.log"/> <suffix value=".yyyy-mm-dd"/> <append value="true"/> </periodic-rotating-file-handler> <logger category="com.arjuna"> <level name="warn"/> </logger> <logger category="org.jboss.as.config"> <level name="debug"/> </logger> <logger category="sun.rmi"> <level name="warn"/> </logger> <root-logger> <level name="info"/> <handlers> <handler name="console"/> <handler name="file"/> </handlers> </root-logger> <formatter name="pattern"> <pattern-formatter pattern="%d{yyyy-mm-dd hh:mm:ss,sss} %-5p [%c] (%t) %s%e%n"/> </formatter> <formatter name="color-pattern"> <pattern-formatter pattern="%k{level}%d{hh:mm:ss,sss} %-5p [%c] (%t) %s%e%n"/> </formatter> </logging-profile> <logging-profile name="another-profile"> <!--another configuration detail !--> </logging-profile> </logging-profiles>
now update application[ear's] manifest.mf file point logging profile needed,
manifest-version: 1.0 logging-profile: first-profile
please follow following link quick reference : http://www.mastertheboss.com/jboss-server/jboss-log/using-a-logger-for-a-specific-application.
i have copied standalone.xml configuration might need change needed on end.
Comments
Post a Comment