This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "jboss-log4j.xml category question" Watch "jboss-log4j.xml category question" New topic

jboss-log4j.xml category question

Rácz György

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
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

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"/>

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 every portlet, the log messages is write correctly the liferay.log or server.log?

Thanks for you help
Rácz György

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

Ceki Gülcü - The complete log4j manual:

Thanks for you help
wood burning stoves
subject: jboss-log4j.xml category question
Similar Threads
log4j.xml for app log.
Jboss final start up message not comes up in console
invalid console appender .....
Unable stop JBOSS running in DEBUG mode
How to monitor log file in jboss for sending mails,when error or excetion found in log