• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Jboss and Log4j

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic