machine-wide config file

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

machine-wide config file

brking
Hello, I've been poking around the documentation a bit and was wondering if its possible to create a logger with a complete path to the config file to use, rather than use the usual web.config or other well known locations. My scenario is I have a logging HttpModule used by many asp.net applications, and I always want to pull the config from a central location on the machine rather than affect the logged application's web.config at all. Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: machine-wide config file

Jarek Kowalski
Administrator
See this thread:

http://www.nabble.com/newbie-usage-question-tf1952903s6167.html

It looks similar to what you're trying to achieve.
NLog Blog
Reply | Threaded
Open this post in threaded view
|

Re: machine-wide config file

brking
Thanks, yet thats what I needed. I'm curious now though since you say in that thread that running NLog from the GAC is not recommended. Can you elaborate on why thats not recommended ?
Reply | Threaded
Open this post in threaded view
|

Re: machine-wide config file

Jarek Kowalski
Administrator
It's not recommended to place NLog.dll in the GAC because components in GAC have no place to put the configuration file, so the option of NLog.dll.nlog is not available. That's why.

There also some issues which I find personally annoying. Like:

Compile a.dll (version 1.0.0.0) and b.exe into a directory. b.exe references a.dll
gacutil /i a.dll
Recompile a.dll after some change without changing version number
Run b.exe - guess what version it uses? It is the version from GAC, but the intuition says it should use the one from the directory, as it is "closer" to the exe.
NLog Blog