aspose file tools*
The moose likes Other Open Source Projects and the fly likes log4j question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j question" Watch "log4j question" New topic
Author

log4j question

luri ron
Ranch Hand

Joined: Dec 11, 2008
Posts: 87
i have the following defined log4j.xml



if i want to prepend /home/myid in front of log/test.log before the test.log is created and logged. how do i do it before the log4j start to write to the log file? thanks.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

luri ron wrote:i have the following defined log4j.xml



if i want to prepend /home/myid in front of log/test.log before the test.log is created and logged. how do i do it before the log4j start to write to the log file? thanks.


I might be confused here but why don't you just declare:



Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Using my magic 8 ball I am guessing what you are looking for...

You can use system properties to specify the log directory see recent log4j post I answered with question about how to specify the log dir from the environment.

You can do the whole thing programmatically instead of using the properties or xml file and specify the log dir however you like then.

Or you can clarify the question.

luri ron
Ranch Hand

Joined: Dec 11, 2008
Posts: 87
using system property is what i needed.

the purpose is to allowed each user to start their program from anywhere and can specify where to write the log to through the start up script. thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j question