Logging and OpenFileDialog

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Logging and OpenFileDialog

Simon Croucher
Hi all,

I have a reproducible (on my setup) problem with NLog.

Logging works great until I open an OpenFileDialog and select any file
and click ok. After that no further logging actually makes it to the log
files. Stepping through my code the logging statements are run but they
just don't do anything.
If I click cancel on the OpenFileDialog, logging works fine afterwards.

Even if I break this down into a new Windows application with nothing on
it except a button and an OpenFileDialog component. My log config is in
the app.config and I have stripped it out to one target and one rule.

Can anyone else reproduce this?

Thanks
Simon


-----------------------------------------------------------------------------------------
Vote for Amadeus as best 'agency desktop tools' provider on Travelmole.com

This communication contains information which is confidential and may also be privileged. It is for the exclusive use of the addressee. If you are not the addressee please note that any distribution, reproduction, copying, publication or use of this communication or the information in it is prohibited. If you have received this communication in error, please notify Amadeus immediately by replying to the email and also delete the communication from your computer.




-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Logging and OpenFileDialog

Jarek Kowalski
Administrator
Can you send a compilable project preferably with an executable?

Jarek

----- Original Message -----
From: "Simon Croucher" <[hidden email]>
To: <[hidden email]>
Sent: Thursday, November 10, 2005 3:00 PM
Subject: [Nlog-list] Logging and OpenFileDialog


> Hi all,
>
> I have a reproducible (on my setup) problem with NLog.
>
> Logging works great until I open an OpenFileDialog and select any file
> and click ok. After that no further logging actually makes it to the log
> files. Stepping through my code the logging statements are run but they
> just don't do anything.
> If I click cancel on the OpenFileDialog, logging works fine afterwards.
>
> Even if I break this down into a new Windows application with nothing on
> it except a button and an OpenFileDialog component. My log config is in
> the app.config and I have stripped it out to one target and one rule.
>
> Can anyone else reproduce this?
>
> Thanks
> Simon
>
>
> -----------------------------------------------------------------------------------------
> Vote for Amadeus as best 'agency desktop tools' provider on Travelmole.com
>
> This communication contains information which is confidential and may also
> be privileged. It is for the exclusive use of the addressee. If you are
> not the addressee please note that any distribution, reproduction,
> copying, publication or use of this communication or the information in it
> is prohibited. If you have received this communication in error, please
> notify Amadeus immediately by replying to the email and also delete the
> communication from your computer.
>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Nlog-list mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/nlog-list
>



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Nlog-list mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/nlog-list
NLog Blog
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Logging and OpenFileDialog

TheMaverick
Hm, AFAIK the openfiledialog do change the Environment.CurrentDirectory to the directory which the openfiledialog was pointed to.
Maybe this could be the problem?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Logging and OpenFileDialog

Jarek Kowalski
Administrator
If this is really the case you may want to use ${basedir} layout renderer or something similar to make your log files be working directory independent.

<target name="file" type="File" filename="${basedir}/log.txt" />

This will write to the file in the directory where your *.exe is located regardless of current working directory setting.

Jarek

NLog Blog
Loading...