You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-user@logging.apache.org by Paul_uniquename <wa...@yahoo.com> on 2007/11/14 07:17:18 UTC

No logs on vista in program files

No logs are written on vista. 

I assume this is because the application is run as user not admin, and
therefore log4net can't write to program files area?

Where are you writing your logs on vista?

-- 
View this message in context: http://www.nabble.com/No-logs-on-vista-in-program-files-tf4802432.html#a13740585
Sent from the Log4net - Users mailing list archive at Nabble.com.


Re: No logs on vista in program files

Posted by Paul_uniquename <wa...@yahoo.com>.
I found out on another forum that you can use environment variables. 

<file value="${ALLUSERSPROFILE}\Application Data\MyStuff\logs\MyLog.log" />

This is the solution I needed.


-- 
View this message in context: http://www.nabble.com/No-logs-on-vista-in-program-files-tf4802432.html#a14164239
Sent from the Log4net - Users mailing list archive at Nabble.com.


Re: No logs on vista in program files

Posted by Paul_uniquename <wa...@yahoo.com>.
Not only that, I am using a static logger class that uses
XmlConfigurator.ConfigureAndWatch().

I only have the Environment.SpecialFolder.CommonApplicationData setting at
runtime. Have you got any code that fixes this on vista? I can't edit
log4net.config at design time with the new path or can I?

<file value="mylog.log" />

Is there an easy way to make it use a directory under
Environment.SpecialFolder.CommonApplicationData without recoding the log
class?

Of course I'm not sure a user can write to CommonApplicationData either.
-- 
View this message in context: http://www.nabble.com/No-logs-on-vista-in-program-files-tf4802432.html#a13740704
Sent from the Log4net - Users mailing list archive at Nabble.com.