Hi
I am trying to use NLog (
http://nlog-project.org) within OpenQuant to produce various log messages sent to different targets (file, console, growl, etc.). In order to use it you need to reference NLog.dll in in your VS project and to copy the NLog.config file to the folder where the executable of the VS project/application is stored.
Wiki of NLog is saying following:
Quote:
NLog attempts to automatically configure itself on startup, by looking for the configuration files in some standard places.
The following locations will be searched when executing a stand-alone *.exe application:
standard application configuration file (usually applicationname.exe.config)
applicationname.exe.nlog in application’s directory
NLog.config in application’s directory
NLog.dll.nlog in a directory where NLog.dll is located
file name pointed by the NLOG_GLOBAL_CONFIG_FILE environment variable (if defined, NLog 1.0 only - support removed in NLog 2.0)
In case of an ASP.NET application, the following files are searched:
standard web application file web.config
web.nlog located in the same directory as web.config
NLog.config in application’s directory
NLog.dll.nlog in a directory where NLog.dll is located
file name pointed by the NLOG_GLOBAL_CONFIG_FILE environment variable (if defined, NLog 1.0 only - support removed in NLog 2.0)
The .NET Compact Framework doesn’t recognize application configuration files (*.exe.config) nor environmental variables, so NLog only looks in these locations:
applicationname.exe.nlog in application’s directory
NLog.config in application’s directory
NLog.dll.nlog in a directory where NLog.dll is located
I stored my NLog.config file in different locations: /SmartQuant Ltd./OpenQuant/ (where OpenQuant.exe is stored), /SmartQuant Ltd./OpenQuant/Bin, /SmartQuant Ltd./OpenQuant/Framework/bin but it didn't work. I do not have a break in the code nor an error message. The logs are just not created. The NLog.dll is stored in /SmartQuant Ltd./OpenQuant/Bin and referenced in OpenQuant.
Does anyone has used NLog within OQ? Do you have an idea where I need to save the NLog.config file?
Many thanks,
Boris