Or configure logging programatically - this way you can set any path 
RR

-----Původní zpráva-----
Od: Roy Chastain [mailto:r...@roychastain.org] 
Odesláno: 27. května 2011 13:38
Komu: Log4NET User
Předmět: RE: log4net for .NET 4.0 / Windows 7

Look at 
http://stackoverflow.com/questions/468989/how-to-specify-common-application-data-folder-for-log4net
And http://logging.apache.org/log4net/release/config-examples.html

And you will see the syntax in the file path is ${variablename}  where variable 
name is any (I THINK ANY) environment variable.

Type SET in a Command Prompt to see what variables are defined and which one 
gets to your private appdata directory.  APPDATA or LOCALAPPDATA are probably 
what you are looking for.

----------------------------------------------------------------------
Roy Chastain




-----Original Message-----
From: Monish Naware [mailto:monish.naw...@mphasis.com]
Sent: Friday, May 27, 2011 07:21
To: Log4NET User
Subject: RE: log4net for .NET 4.0 / Windows 7

Roy, I agree to you!
But then what should be the parameter in the config file (for file attribute) 
to get the current user's program directory?

Monish.

-----Original Message-----
From: Roy Chastain [mailto:r...@roychastain.org]
Sent: Friday, May 27, 2011 4:31 PM
To: Log4NET User
Subject: RE: log4net for .NET 4.0 / Windows 7

You SHOULD NOT be writing logs to installation directories.  They should be 
placed in the user  program data directory.  If memory serves, log4Net has a 
"reserved" word for that directory that you can use in the configuration.

ProgramFiles etc are write protected for a reason and you should not unprotect 
it or any part to all writing the log.  That just give malware one more avenue 
of attack.

----------------------------------------------------------------------
Roy Chastain

Reply via email to