-
1. Re: Application logging in server.log though application logs are seperated.
wdfink Mar 7, 2012 7:08 AM (in response to harika.yada)1 of 1 people found this helpfulThis config log all into all files, thats not what you try to do.
Add:
<category name="x.y.z"> <==== your package or log-category
<priority value="TRACE" />
<appender-ref ref="ABCWAR"/>
</category>
This should be before the <root> and remove the appender-ref from root, thats it.
If you want to have the JBoss classes in your logfile then you have to add a filter to the FILE appender that have AcceptOnMatch=false.
But this will be a performance and lock contention issue.
The reason is that the category is checked before the log statement is executed.
The appender filter is inside the file-write-sync-block and you will have locking contention in case of high traffic!
So if you only want to have a business logging of your app use the category.
In case of analyzing problems I would recommend to add the FILE appender to your category and use the server.log for this.
-
2. Re: Application logging in server.log though application logs are seperated.
harika.yada Mar 7, 2012 8:01 AM (in response to wdfink)Thank you Fink.
I have added the category tag and removed the appender-ref from the root tag as mentioned by you.
I have got a new issue now, the server log is updated as usual by all the application logs too while the application logs are empty.
Will you please tell me why this is happening?
These are categories I have added :
<category name="com.abc.rest.constants" >
<priority value="DEBUG" />
<appender-ref ref="ABCWAR" />
</category>
<category name="com.abc.rest.output" >
<priority value="DEBUG" />
<appender-ref ref="ABCWAR" />
</category>
<category name="com.abc.rest.service.application" >
<priority value="DEBUG" />
<appender-ref ref="ABCWAR" />
</category>
<category name="com.abc.rest.service.dbhandler" >
<priority value="DEBUG" />
<appender-ref ref="ABCWAR" />
</category>
...............
<root>
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</root>
-
3. Re: Application logging in server.log though application logs are seperated.
nibuneganesh Jun 10, 2012 11:45 AM (in response to harika.yada)Hi,
Is <appender-ref ref="userAppender"/> is working in Jboss 7.1
-
4. Re: Application logging in server.log though application logs are seperated.
wdfink Jun 11, 2012 7:57 AM (in response to nibuneganesh)no it's different, see the logging subsystem in the configuration.
You have to add a <logger> element with a <handlers> element and add your own file/console handler.