You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Wayne Cannon <wc...@turinnetworks.com> on 2007/08/28 20:50:42 UTC

Re: configuring a log to be written to "c:\documents and settings\\Temp"

Have you considered using and importing the environment variables, such 
as HOME and USERPROFILE (Windows-only).  Yell if you need more 
pointers.  --Wayne

Gabier, Sal wrote:
> Hello all,
>  
> I am trying to write a logfile to "c:\documents and settings\<userid>\Temp"
> on a windows machine. The problem I have is that depending on which machine
> the program is installed on or who logs in, the <userid> directory will
> change. For instance, if "jsmith" logs in, his log file should appear in
> "c:\documents and settings\jsmith\Temp", but if "jdoe" runs the program from
> his account, the log should appear in "c:\documents and settings\jdoe\Temp".
> In my log4j.properties file, I don't know how to make this <userid> a
> variable. I only know how to hardcode it as follows:
>  
> log4j.appender.R.File=log/whatever.log
>  
> Can anyone help me?
>  
> Regards,
>  
> Sal Gabier
> Systems Architect
> TIS2Web - New Development
> Ph 248-603-4413
> Cell 248-425-6985
> Affiliated Computer Services 
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


RE: configuring a log to be written to "c:\documents and settings\\Temp"

Posted by "Harp, George" <GH...@GAINSystems.com>.
Have you tried user.home or user.dir? Java System property? Home
probably what you want

-----Original Message-----
From: Wayne Cannon [mailto:wcannon@turinnetworks.com] 
Sent: Tuesday, August 28, 2007 1:51 PM
To: Log4J Users List
Subject: Re: configuring a log to be written to "c:\documents and
settings\<us erid>\Temp"

Have you considered using and importing the environment variables, such
as HOME and USERPROFILE (Windows-only).  Yell if you need more pointers.
--Wayne

Gabier, Sal wrote:
> Hello all,
>  
> I am trying to write a logfile to "c:\documents and
settings\<userid>\Temp"
> on a windows machine. The problem I have is that depending on which 
> machine the program is installed on or who logs in, the <userid> 
> directory will change. For instance, if "jsmith" logs in, his log file

> should appear in "c:\documents and settings\jsmith\Temp", but if 
> "jdoe" runs the program from his account, the log should appear in
"c:\documents and settings\jdoe\Temp".
> In my log4j.properties file, I don't know how to make this <userid> a 
> variable. I only know how to hardcode it as follows:
>  
> log4j.appender.R.File=log/whatever.log
>  
> Can anyone help me?
>  
> Regards,
>  
> Sal Gabier
> Systems Architect
> TIS2Web - New Development
> Ph 248-603-4413
> Cell 248-425-6985
> Affiliated Computer Services
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org