aspose file tools
The moose likes JBoss and the fly likes Jboss and Log4j Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » JBoss
Reply Bookmark "Jboss and Log4j" Watch "Jboss and Log4j" New topic
Author

Jboss and Log4j

Miguel Flecha
Ranch Hand

Joined: Jun 23, 2004
Posts: 85
Hi all.
I'm trying to use Log4j with Jboss.
I read that log4j.xml properties file must be in server/all/conf, so I put it there. Now I have a couple of questios:

- do I have to add a line like this (DOMConfigurator.configure("log4j.xml") in my program?

-where does it place the log file?

-is this log4j.xml file correct?:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

<appender name="appender" class="org.apache.log4j.FileAppender">
<param name="File" value="salida.log"/>
<param name="Append" value="false"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d [%t] %p - %m%n"/>
</layout>
</appender>

<root>
<priority value ="debug"/>
<appender-ref ref="appender"/>
</root>
</log4j:configuration>

Thanks in advance
Regards from Spain
Jeff Shelley
Ranch Hand

Joined: May 21, 2003
Posts: 70
whic version of jboss are you running? you shouldn't need to write any code for configuration.

the log file will go in server/${whichever-configuration-you-are-running}/log/

Also, the log4j.xml that my jboss came with (3.2.3/tomcat-4.1.24) was a good starting point for my logging. I've never used the all configuration, just the default, so my log4j.xml is in the
${jboss-folder}/server/default/conf/ directory.
if you never changed which configuration to run, that's where you'll find the log4j.xml. this is assuming you're running jboss 3.2.3.


It's almost Friday
Jeff Garrison
Greenhorn

Joined: Apr 09, 2004
Posts: 3
This should do it for you. . .I had the same problem a few mos. back.
I documented my results. Hope it helps.

http://www.garrisonpchelp.com/docs/log4jxml.html

Regards,

-Jeff Garrison
 
 
subject: Jboss and Log4j
 
Threads others viewed
log4j: Why aren't my debug statements showing?
Logging
log4j separate file logging problem
Where are my log4j logs getting written to?
Tomcat with Log4j
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture