Configuration not loading

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

Configuration not loading

Mike
Hi all

My application is separated in layers. I want to use NLog at the lowest level: the data layer. In fact, it works perfectly. The configuration file is loaded and I can see the output in a text file without any problem, WHEN I call my datalayer from a Win32 project. For exemple, when running unit tests, my logs are alright. Also when calling my datalayer from a Win32 project, everything is perfect. The problem is when I call the same functions, from an ASP.Net project. In a WebApplication or a  WebService, there's no output. I used a breakpoint before writting to the log files and I see that the configuration is null. Also IsTraceEnabled, IsFatalEnabled, etc are all set to false.
I tried everything I can think of, including giving Full Control to "Everyone" in the security, always without success.

Any idea ?
Thanks
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

manojgahiwal
Hi Mike,
I am facing same problem in silverlight application?
Did you get the solution for this?

Thanks,
Manoj
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

Jason LaFlair
Administrator
In reply to this post by Mike
For a web project make sure your nlog.config file is in the bin directory.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

manojgahiwal
Thanks Jason, It is in bin folder still it is not loading the configuration for Silverlight. Also It is not logging logs from Silverlight application.

 

On Tue, Jul 31, 2012 at 12:38 AM, Jason LaFlair [via NLog Forum] <[hidden email]> wrote:
For a web project make sure your nlog.config file is in the bin directory.


If you reply to this email, your message will be added to the discussion below:
http://nlog-forum.1685105.n2.nabble.com/Configuration-not-loading-tp5655366p7577452.html
To unsubscribe from Configuration not loading, click here.
NAML

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

Jason LaFlair
Administrator
Are you using the the silverlight build of nlog?  Just to justify, I am not at all familiar with silverlight itself.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

manojgahiwal
I am using nlog dll for silverlight. The Nlog config file is in web
project, as its gets copied to bin. Please let me know what I m
missing.
Thanks for great support.

On 8/1/12, Jason LaFlair [via NLog Forum]
<[hidden email]> wrote:

>
>
> Are you using the the silverlight build of nlog?  Just to justify, I am not
> at all familiar with silverlight itself.
>
>
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion
> below:
> http://nlog-forum.1685105.n2.nabble.com/Configuration-not-loading-tp5655366p7577462.html
>
> To unsubscribe from Configuration not loading, visit
>
Sent from my mobile device
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

Jason LaFlair
Administrator
Sadly I'm at a loss, my kung-fu doesn't cover that of Silverlight.

Anyone else have some direction?

Jason.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

manojgahiwal
Hi Jason,
I have added new configuration in the silverlight application as below. Tried to log the info however could not do so.
Is is mandatory to add the web service to transfer the data from silverlight to web application? Your help will be helpful to me.

 SimpleConfigurator.ConfigureForTargetLogging(
                new FileTarget
                    {
                        FileName = "E:\\MyLog.txt",
                        Layout = new CsvLayout()
                                     {
                                         Columns =
                                             {
                                                 new CsvColumn("Time", "${longdate}"),
                                                 new CsvColumn("Level", "${level}"),
                                                 new CsvColumn("Lessage", "${message}"),
                                                 new CsvColumn("Logger", "${logger}"),
                                             },
                                     }
                    },
                LogLevel.Debug);
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Configuration not loading

Jason LaFlair
Administrator
Could you attach your whole configuration so I can get a full look at it?
Loading...