Click here to Skip to main content
15,886,110 members
Articles / Programming Languages / C#

Logging with NLog

Rate me:
Please Sign up or sign in to vote.
1.68/5 (13 votes)
6 Jan 20073 min read 52.2K   69   20  
The article describes how to configure nlog to log reports as per your requirement
@echo off
set DOTNETSDK_DIR=C:\Program Files\Microsoft.NET\FrameworkSDK
set VS_DIR=C:\Program Files\Microsoft Visual Studio .NET
set VC_DIR=%VS_DIR%\VC7
set FRAMEWORK_DIR=%WINDIR%\Microsoft.NET\Framework\v1.0.3750
set NLOG_BASE_DIR=%CD%

set PATH=%VC_DIR%\bin;%VS_DIR%\Common7\ide;%PATH%
set INCLUDE=%VC_DIR%\include
set LIB=%VC_DIR%\lib;%DOTNETSDK_DIR%\Lib
set NLOG_BIN_DIR=%1
set SOURCE_DIR=src\NLogC
set OUTPUT_DIR=%2\bin\net-1.0
set OUTPUT_FILE=NLogC

mkdir %OUTPUT_DIR%

cl /nologo /O2 /AI %NLOG_BIN_DIR% /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "NLOGC_EXPORTS" /D "_WINDLL" /D "_MBCS" /FD /EHsc /MT /GS /W3 /c /Wp64 /Zi /clr /TP /FU "%FRAMEWORK_DIR%\mscorlib.dll" /FU "%NLOG_BIN_DIR%\NLog.dll" /Fo%OUTPUT_DIR%\%OUTPUT_FILE%.obj %SOURCE_DIR%\NLogC.cpp
link /nologo /OUT:"%OUTPUT_DIR%\%OUTPUT_FILE%.dll" /INCREMENTAL:NO /NOLOGO /DLL /DEBUG /PDB:"%OUTPUT_DIR%\%OUTPUT_FILE%.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /IMPLIB:"%OUTPUT_DIR%\%OUTPUT_FILE%.lib" /MACHINE:X86 /FIXED:No /NOENTRY /NODEFAULTLIB:nochkclr.obj /INCLUDE:__DllMainCRTStartup@12 %OUTPUT_DIR%\%OUTPUT_FILE%.obj
del "%OUTPUT_DIR%\%OUTPUT_FILE%.obj"

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions