• 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
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

using log4j in jboss--help needed please!!!

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Could anyone tell me please how to configure a log file in xml
so that all log messages are written in a local C:/log/test.log file.

i am using jboss 4.0.3

please guide !

Thanks in advance!
 
author
Posts: 288
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
under "JBOSS_HOME/<your server>/conf" thre should be a log4j.xml





specify your path there. Also have a look at jboss-service.xml under conf/ dir.
 
vasundhara Neeraj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ak!

Could you send me the exact code please...
ie what all changes need to be done in the xml...

as i tried this way prevously it did not work.
i tried using properties file as in weblogic
and it also failed..

I am seriously seeking the solution to it..in my work.

Please help!
Thanks!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


as i tried this way prevously it did not work


Can you show us what you tried? ak pillai has already correctly shown you how to configure an appender that logs to a file, so if you've done the same it will work.
 
vasundhara Neeraj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Hi,
I changed only the above line to the following line

<param name="File" value="C:\log\test.log"/>


see with the code mentioned by Ak..we can very well define a path inside server directory..what i want is to deifne a path inside C: which i am not able to.
Please guide !
Thanks!
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your appender listed in the root category? Look in log4j.xml for an entry like:

Make sure your appender is listed there.
 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try

<param name="File" value="/log/test.log"/>

or

<param name="File" value="C:\\log\\test.log"/>


Both work for us in Windows

Padma
 
vasundhara Neeraj
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Padma

Thanks a lot!! to everybuddy!!

The first option you gave---

It Worked !!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic