I'm using Jboss 7.1.1 and I have the following log definition:
<subsystem xmlns="urn:jboss:domain:logging:1.1">
<console-handler name="CONSOLE">
<level name="INFO"/>
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
</console-handler>
<periodic-rotating-file-handler name="FILE">
<formatter>
<pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="server.log"/>
<suffix value=".yyyy-MM-dd"/>
<append value="true"/>
</periodic-rotating-file-handler>
<size-rotating-file-handler name="ACEII">
<level name="DEBUG"/>
<formatter>
<pattern-formatter pattern="%z{utc}%d{dd/MM/yyyy HH:mm:ss,SSS} %-5p [%c] %s%E%n"/>
</formatter>
<file relative-to="jboss.server.log.dir" path="ACEII.log"/>
<rotate-size value="10M"/>
<max-backup-index value="10"/>
<append value="true"/>
</size-rotating-file-handler>
<logger category="ace2" use-parent-handlers="false">
<level name="DEBUG"/>
<handlers>
<handler name="ACEII"/>
</handlers>
</logger>
<logger category="com.arjuna">
<level name="WARN"/>
</logger>
<logger category="org.apache.tomcat.util.modeler">
<level name="WARN"/>
</logger>
<logger category="sun.rmi">
<level name="WARN"/>
</logger>
<logger category="jacorb">
<level name="WARN"/>
</logger>
<logger category="jacorb.config">
<level name="ERROR"/>
</logger>
<root-logger>
<level name="INFO"/>
<handlers>
<handler name="CONSOLE"/>
<handler name="FILE"/>
</handlers>
</root-logger>
</subsystem>
I'd like the ACE log to be written to a different folder, so I tried putting different values in the relative-to attribute but nothing seems to work, any idea on how to do it?
This is what I use; I then handle log rotation with
logrotate
:Obviously, you can modify this to suit your needs.
This works just fine for me.
Know this is an older question, but still found it relevant for JBOSS EAP 7
I found James response from here insightful - https://developer.jboss.org/wiki/Wildfly82LogPathChange
I was able to edit the standalone.conf and specify the custom logging directory there.
The is also a domain.conf that can be edited for domain mode.
All that is needed it to add the following to the end of the file:
As I understand it for Windows the .bat files can be updated instead of the .conf files.
Found the answer :)
I'm using Java service wrapper to install Jboss as a windows service and that service has a configuration file located in a certain path, so I've noticed that if i remove the relative-to attribute it write the logs to the folder where the configuration file is located.
All i had to do define it like this:
And that did the trick for me.
You need to leave off the
relative-to
and enter the absolute path in thepath
attribute.You can also use your own relative path by adding a path to your configuration.
In CLI you would just execute:
/path=my.log.dir:add(path="/var/log")
If you just want to edit the xml add the following.
Paths themselves can have a relative path if you wanted to define specif directories in a default log directory for example.
Once you have your path defined you can use the name you gave the path in the
relative-to
attribute.