It's not a secret anymore!*
The moose likes JBoss/WildFly and the fly likes jboss-log4j.xml category question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "jboss-log4j.xml category question" Watch "jboss-log4j.xml category question" New topic
Author

jboss-log4j.xml category question

Rácz György
Greenhorn

Joined: Nov 12, 2008
Posts: 19
Hello All!

Sorry for my bad english!

I am writing simple JSP portlet application, i want to log the details. So i am using the log4j which is in jboss/server/default/conf folder.
The content of jboss-log4j.xml is as follows:



I have inserted a appender and a category (com.geosoft) in the jboss-log4j.xml, but after server started still my data are logged to the console
not in liferay.log file.



After i modified jboss-log4j.xml (insert some enter), i am finding that it is hanging on the line below (via the console):
14:46:49,308 INFO [Log4jService$URLWatchTimerTask:599] Configuring from URL: resource:jboss-log4j.xml

Then liferay.log and server.log file is cleared and WORKS FINE (contains this):



I think that, when start jboss as, doesn't load jboss-log4j.xml fully...

Please help me to solve this....

Thanks for you help
Geo
uttam kumar
Ranch Hand

Joined: Jan 27, 2009
Posts: 128

Hi Rácz,

Please do not modify jboss-log4j.xml. This xml file is for JBoss logging. If you want your application to use log4j please make a separate configuration file and add it into your jar/ear. In your configuration file you can specify the log file name as well as its location. Hope this helps.
Rácz György
Greenhorn

Joined: Nov 12, 2008
Posts: 19
Hi uttam kumar!

I am using Liferay 5.2 SP4 bundled with JBoss. I think my problem is that, JBoss doesn't picked up correctly my jboss-log4j.xml.

<category name="com.geosoft">
<priority value="WARN" />
<appender-ref ref="LIFERAY"/>
</category>

But if i modify the jboss-log4j.xml, the category settings load correctly, and works. It works only modify the .xml file. Why?

You think, if i create log4j.properties every portlet, the log messages is write correctly the liferay.log or server.log?

Thanks for you help
Geo
Rácz György
Greenhorn

Joined: Nov 12, 2008
Posts: 19
Hi All!

Ceki Gülcü - The complete log4j manual:

http://books.google.co.uk/books?id=hZBimlxiyAcC&pg=PA91&lpg=PA91&dq=jboss-log4j.xml+load+problem&source=bl&ots=QeQob3b3T4&sig=8bschge1znaeSh-TwcSZjeidKv0&hl=hu&ei=nFVrTe2UKMbItAbmxYj1DA&sa=X&oi=book_result&ct=result&resnum=4&ved=0CC4Q6AEwAzhk#v=onepage&q&f=false

Thanks for you help
Geo
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jboss-log4j.xml category question