9 |
--------------------------------------------------------------------------------
/src/LocalTestRun.testrunconfig:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a default test run configuration for a local test run.
4 |
5 |
--------------------------------------------------------------------------------
/examples/web/config7.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/LocalTestRun.vs2008.testrunconfig:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a default test run configuration for a local test run.
4 |
5 |
--------------------------------------------------------------------------------
/examples/web/article6.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetTrace/web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/tests/NLog.UnitTests/NLog.UnitTests.dll.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/examples/web/config9.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tests/NLogC.UnitTests/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Trace/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/tests/webtest/test.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page language="c#" AutoEventWireup="true" %>
2 |
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Debug/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Memory/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Debugger/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Null/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp.Web/Default.aspx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Web;
5 | using System.Web.UI;
6 | using System.Web.UI.WebControls;
7 |
8 | namespace NLogSilverlightApp.Web
9 | {
10 | public partial class _Default : System.Web.UI.Page
11 | {
12 | protected void Page_Load(object sender, EventArgs e)
13 | {
14 |
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/ASPNetTrace/web.nlog:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/OutputDebugString/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/tests/NLog.ComInteropTests/NLog.ComInteropTest.cmd:
--------------------------------------------------------------------------------
1 | @echo off
2 | echo Registering NLog.ComInterop...
3 | call "%~dp0Install_NLog_ComInterop.cmd" || exit /b 1
4 | echo Running tests...
5 | cscript //nologo "%~dp0NLog.ComInteropTest.js" "%~dp0NLog.ComInteropTest.config"
6 | set RESULT=%ERRORLEVEL%
7 | echo Exit code: %RESULT%.
8 | echo Unregistering NLog.ComInterop...
9 | call "%~dp0Uninstall_NLog_ComInterop.cmd" || exit /b 1
10 | exit /b %RESULT%
11 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Chainsaw/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/NLogViewer/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/NLogReceiverForwarderService/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("ASPNetBufferingWrapper")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: ComVisible(false)]
9 | [assembly: AssemblyVersion("1.0.0.0")]
10 | [assembly: AssemblyFileVersion("1.0.0.0")]
11 |
--------------------------------------------------------------------------------
/src/NuGet/NLog.Config/tools/Install.ps1:
--------------------------------------------------------------------------------
1 | param($installPath, $toolsPath, $package, $project)
2 |
3 | $configItem = $project.ProjectItems.Item("NLog.config")
4 |
5 | // set 'Copy To Output Directory' to 'Copy if newer'
6 | $copyToOutput = $configItem.Properties.Item("CopyToOutputDirectory")
7 | $copyToOutput.Value = 1
8 |
9 | // set 'Build Action' to 'Content'
10 | $buildAction = $configItem.Properties.Item("BuildAction")
11 | $buildAction.Value = 2
12 |
13 |
--------------------------------------------------------------------------------
/tests/NLog.BinaryCompatTests/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tests/NLog.BinaryCompatTests/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/ExtendingLoggers/LoggerWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Console/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/MessageBox/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | obj/
2 | bin/
3 | Bin/
4 | msbuild.log
5 | LastTestRunSummary.cmd
6 | src/Docs/Working/
7 | test-results/
8 | *.chw
9 | *.pidb
10 | *.userprefs
11 | log.txt
12 | *.suo
13 | _ReSharper.*
14 | *.ReSharper.user
15 | *.bak
16 | *.csproj.user
17 | *.vcxproj.user
18 | TestResults/
19 | StyleCop.Cache
20 | NLogMerged.api.xml
21 | _UpgradeReport_Files/
22 | UpgradeLog*.XML
23 | *.xap
24 | ipch/
25 | *.sdf
26 | *.opensdf
27 | examples/NLogDemo/logs/
28 | examples/NLogDemo/gmail*.txt
29 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Database/MSSQL/drop_nlog_database.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set DBNAME=NLogDatabase
3 | if (%1)==() goto usage
4 | cls
5 | echo.
6 | echo This will drop %DBNAME% database on %1
7 | echo.
8 | echo You can press Ctrl+C to quit now.
9 | echo.
10 | pause
11 | osql -S %1 -E -n -i drop_nlog_database.sql
12 | pause
13 | goto quit
14 |
15 | :usage
16 | echo Usage: drop_nlog_database.bat HOSTNAME
17 | echo This will drop %DBNAME% database on HOSTNAME
18 |
19 | :quit
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/EventLog/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/publisher_policy.config.template:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Network/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/EmptyNLogConfig/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/FormControl/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/web/config5.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/ColoredConsole/Simple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/web/config10.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/AutoFlushWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/NLog.netfx20.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/NLog.netfx35.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/NLog.netfx40.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/SilverlightApp/Properties/OutOfBrowserSettings.xml:
--------------------------------------------------------------------------------
1 |
2 | SilverlightApp.sl4 Application on your desktop; at home, at work or on the go.
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Debugger/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | DebuggerTarget target = new DebuggerTarget();
11 | target.Layout = "${message}";
12 |
13 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
14 |
15 | Logger logger = LogManager.GetLogger("Example");
16 | logger.Debug("log message");
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Multiple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/NLog.netcf20.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/NLog.netcf35.vsmdi:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Console/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 |
4 | class Example
5 | {
6 | static void Main(string[] args)
7 | {
8 | ConsoleTarget target = new ConsoleTarget();
9 | target.Layout = "${date:format=HH\\:MM\\:ss} ${logger} ${message}";
10 |
11 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
12 |
13 | Logger logger = LogManager.GetLogger("Example");
14 | logger.Debug("log message");
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/BufferingWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RepeatingWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RichTextBox/Simple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/web/Performance.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 |
3 | class MyClass {
4 | // storing logger reference in a static variable is clean and fast
5 | static Logger logger = LogManager.GetLogger("MyClass");
6 |
7 | static void Main()
8 | {
9 | logger.Debug("This is a debugging message");
10 |
11 | // it is not recommended to get the logger and store it in a local variable
12 | Logger logger2 = LogManager.GetLogger("MyClass");
13 | logger2.Debug("This is a debugging message");
14 | }
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/src/NLog/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click
8 | // "In Project Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
--------------------------------------------------------------------------------
/tests/NLog.ComInteropTests/NLog.ComInteropTest.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp.Web/Default.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NLogSilverlightApp.Web._Default" %>
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/PerfCounter/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/tests/NLog.Test/Config2.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/NLogWindowsPhoneApplication/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 | ${xml-encode:${message}}]]>
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tests/NLog.UnitTests/Properties/OutOfBrowserSettings.xml:
--------------------------------------------------------------------------------
1 |
2 | NLog.Silverlight3.UnitTests Application on your desktop; at home, at work or on the go.
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/NLog.Extended/GlobalSuppressions.cs:
--------------------------------------------------------------------------------
1 | // This file is used by Code Analysis to maintain SuppressMessage
2 | // attributes that are applied to this project.
3 | // Project-level suppressions either have no target or are given
4 | // a specific target and scoped to a namespace, type, member, etc.
5 | //
6 | // To add a suppression to this file, right-click the message in the
7 | // Error List, point to "Suppress Message(s)", and click
8 | // "In Project Suppression File".
9 | // You do not need to add suppressions to this file manually.
10 |
11 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Null/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | NullTarget target = new NullTarget();
11 | target.Layout = "${message}";
12 | target.FormatMessage = true;
13 |
14 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
15 |
16 | Logger logger = LogManager.GetLogger("Example");
17 | logger.Debug("log message");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/tests/NLog.Test/Config1.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Database/MSSQL/create_nlog_database.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | set DBNAME=NLogDatabase
3 | if (%1)==() goto usage
4 | set LOGIN=
5 | if (%2)==() set LOGIN=-E
6 | cls
7 | echo.
8 | echo This will create %DBNAME% database on %1
9 | echo.
10 | echo You can press Ctrl+C to quit now.
11 | echo.
12 | pause
13 | osql -S %1 %LOGIN% %2 %3 %4 %5 %6 -n -i create_nlog_database.sql
14 | pause
15 | goto quit
16 |
17 | :usage
18 | echo Usage: create_nlog_database.bat HOSTNAME
19 | echo This will create %DBNAME% database on HOSTNAME
20 |
21 | :quit
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/FilteringWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/tools/SilverlightConsoleRunner/RunnerForm.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 | using System.Windows.Forms;
4 |
5 | namespace SilverlightConsoleRunner
6 | {
7 | public partial class RunnerForm : Form
8 | {
9 | public RunnerForm()
10 | {
11 | InitializeComponent();
12 | }
13 |
14 | public string Url { get; set; }
15 |
16 | private void RunnerForm_Load(object sender, EventArgs e)
17 | {
18 | webBrowser1.Navigate(this.Url);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RetryingWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/tests/NLog.ComInteropTests/Deploy.cmd:
--------------------------------------------------------------------------------
1 | set NETFX_VERSION=%1
2 | set DEST_DIR=%2
3 | copy %~dp0\NLog.ComInteropTest.* %DEST_DIR%
4 | echo %%WINDIR%%\Microsoft.NET\Framework\%NETFX_VERSION%\RegAsm.exe /nologo /unregister "%%~dp0NLog.dll" > %DEST_DIR%\Uninstall_NLog_ComInterop.cmd
5 | echo exit /b %%ERRORLEVEL%% >> %DEST_DIR%\Uninstall_NLog_ComInterop.cmd
6 | echo %%WINDIR%%\Microsoft.NET\Framework\%NETFX_VERSION%\RegAsm.exe /nologo /codebase "%%~dp0NLog.dll" /tlb > %DEST_DIR%\Install_NLog_ComInterop.cmd
7 | echo exit /b %%ERRORLEVEL%% >> %DEST_DIR%\Install_NLog_ComInterop.cmd
8 |
9 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Multiple2/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/tools/Installer/build.cmd:
--------------------------------------------------------------------------------
1 | C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Installer.wixproj /p:Flavor=All /p:Configuration=Release || exit /b 1
2 | msiexec /x {a93e5783-ae19-41cb-a99d-4b04de0b0192} /passive
3 | msiexec /x {a93e5783-ae19-41cb-a99d-4b04de0b0193} /passive
4 | msiexec /x {a93e5783-ae19-41cb-a99d-4b04de0b0194} /passive
5 | msiexec /x {a93e5783-ae19-41cb-a99d-4b04de0b0195} /passive
6 | msiexec /x {a93e5783-ae19-41cb-a99d-4b04de0b0196} /passive
7 | msiexec /lv* log.txt /i D:\Work\NLog\build\bin\Release\Packages\NLog2-All-PrivateBuild.msi
8 | echo ERRORLEVEL: %ERRORLEVEL%
--------------------------------------------------------------------------------
/examples/targets/Configuration API/OutputDebugString/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Win32.Targets;
6 |
7 | class Example
8 | {
9 | static void Main(string[] args)
10 | {
11 | OutputDebugStringTarget target = new OutputDebugStringTarget();
12 | target.Layout = "${message}";
13 |
14 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
15 |
16 | Logger logger = LogManager.GetLogger("Example");
17 | logger.Debug("log message");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Mail/Simple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/MethodCall/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/SplitGroup/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/WebService/WebService1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("WebService1")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyTrademark("")]
9 | [assembly: AssemblyCulture("")]
10 | [assembly: ComVisible(false)]
11 | [assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
12 | [assembly: AssemblyVersion("1.0.0.0")]
13 | [assembly: AssemblyFileVersion("1.0.0.0")]
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/NormalPage.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NormalPage.aspx.cs" Inherits="ASPNetBufferingWrapper.NormalPage" %>
2 |
3 |
4 |
5 |
6 |
7 | Untitled Page
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/MessageBox/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | MessageBoxTarget target = new MessageBoxTarget();
11 | target.Layout = "${longdate}: ${message}";
12 | target.Caption = "${level} message";
13 |
14 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
15 |
16 | Logger logger = LogManager.GetLogger("Example");
17 | logger.Debug("log message");
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/WebService/Simple/WebService1/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | [assembly: AssemblyTitle("WebService1")]
6 | [assembly: AssemblyDescription("")]
7 | [assembly: AssemblyConfiguration("")]
8 | [assembly: AssemblyTrademark("")]
9 | [assembly: AssemblyCulture("")]
10 | [assembly: ComVisible(false)]
11 | [assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")]
12 | [assembly: AssemblyVersion("1.0.0.0")]
13 | [assembly: AssemblyFileVersion("1.0.0.0")]
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RandomizeGroup/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RoundRobinGroup/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/ExtendingLoggers/InheritFromLogger/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/PageWithWarnings.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PageWithWarnings.aspx.cs" Inherits="ASPNetBufferingWrapper.PageWithWarnings" %>
2 |
3 |
4 |
5 |
6 |
7 | Untitled Page
8 |
9 |
10 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Simple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/MSMQ/Simple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/tests/webtest/context.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page language="c#" AutoEventWireup="true" %>
2 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Trace/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using System.Diagnostics;
6 |
7 | class Example
8 | {
9 | static void Main(string[] args)
10 | {
11 | Trace.Listeners.Add(new ConsoleTraceListener());
12 |
13 | TraceTarget target = new TraceTarget();
14 | target.Layout = "${message}";
15 |
16 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
17 |
18 | Logger logger = LogManager.GetLogger("Example");
19 | logger.Debug("log message");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/MSMQ/Multiple/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/FallbackGroup/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/web/config11.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/ConsoleNLogConfig/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/NLogDemo/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp.Web/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/tests/NLogReceiverService/clientaccesspolicy.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/FileNLogConfig/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Memory/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | MemoryTarget target = new MemoryTarget();
11 | target.Layout = "${message}";
12 |
13 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
14 |
15 | Logger logger = LogManager.GetLogger("Example");
16 | logger.Debug("log message");
17 |
18 | foreach (string s in target.Logs)
19 | {
20 | Console.Write("logged: {0}", s);
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/NLogWindowsPhoneApplication/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace NLogWindowsPhoneApplication
2 | {
3 | using System.Windows;
4 | using Microsoft.Phone.Controls;
5 |
6 | using NLog;
7 |
8 | public partial class MainPage : PhoneApplicationPage
9 | {
10 | private static Logger logger = LogManager.GetCurrentClassLogger();
11 |
12 | // Constructor
13 | public MainPage()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void button1_Click(object sender, RoutedEventArgs e)
19 | {
20 | logger.Info("Hello <> 'foo' \"bar\" !");
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/examples/targets/Configuration API/FormControl/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | namespace RichTextBox2
7 | {
8 | static class Example
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | // for NLog configuration look in Form1.cs
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RichTextBox/WordColoring/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/EventLog/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using NLog.Win32.Targets;
4 |
5 | class Example
6 | {
7 | static void Main(string[] args)
8 | {
9 | EventLogTarget target = new EventLogTarget();
10 | target.Source = "My Source";
11 | target.Log = "Application";
12 | target.MachineName = ".";
13 | target.Layout = "${logger}: ${message}";
14 |
15 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
16 |
17 | Logger logger = LogManager.GetLogger("Example");
18 | logger.Debug("log message");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RichTextBox/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | namespace RichTextBox2
7 | {
8 | static class Example
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | // for NLog configuration look in Form1.cs
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RichTextBox/RowColoring/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | namespace RichTextBox2
7 | {
8 | static class Example
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | // for NLog configuration look in Form1.cs
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/examples/targets/Configuration File/ColoredConsole/Word Highlighting/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RichTextBox/WordColoring/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Windows.Forms;
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | namespace RichTextBox2
7 | {
8 | static class Example
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new Form1());
19 | // for NLog configuration look in Form1.cs
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/tests/NLog.VBTest/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/NLog/CustomDictionary.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | configurator
6 | Renderer
7 | Reconfig
8 | Precalculate
9 | Renderers
10 | Ddl
11 | gdc
12 | ndc
13 | mdc
14 | ddl
15 | xap
16 |
17 |
18 |
19 |
20 | NLog
21 | CRLF
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Multiple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using System.Text;
4 |
5 | class Example
6 | {
7 | static void Main(string[] args)
8 | {
9 | FileTarget target = new FileTarget();
10 | target.Layout = "${longdate} ${logger} ${message}";
11 | target.FileName = "${basedir}/${level}.log";
12 | target.KeepFileOpen = false;
13 | target.Encoding = Encoding.UTF8;
14 |
15 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
16 |
17 | Logger logger = LogManager.GetLogger("Example");
18 | logger.Debug("log message");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using System.Text;
4 |
5 | class Example
6 | {
7 | static void Main(string[] args)
8 | {
9 | FileTarget target = new FileTarget();
10 | target.Layout = "${longdate} ${logger} ${message}";
11 | target.FileName = "${basedir}/logs/logfile.txt";
12 | target.KeepFileOpen = false;
13 | target.Encoding = Encoding.UTF8;
14 |
15 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
16 |
17 | Logger logger = LogManager.GetLogger("Example");
18 | logger.Debug("log message");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/src/NLog.Extended/CustomDictionary.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | configurator
6 | Renderer
7 | Reconfig
8 | Precalculate
9 | Renderers
10 | Ddl
11 | gdc
12 | ndc
13 | mdc
14 | ddl
15 | xap
16 |
17 |
18 |
19 |
20 | NLog
21 | CRLF
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Mail/Buffered/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/NormalPage.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.42
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ASPNetBufferingWrapper
12 | {
13 |
14 | public partial class NormalPage
15 | {
16 | protected System.Web.UI.HtmlControls.HtmlForm form1;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/RichTextBox/RowColoring/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/PageWithWarnings.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.42
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace ASPNetBufferingWrapper
12 | {
13 |
14 | public partial class PageWithWarnings
15 | {
16 | protected System.Web.UI.HtmlControls.HtmlForm form1;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/SmartDeviceTestRun.testrunConfig:
--------------------------------------------------------------------------------
1 |
2 |
3 | This is a default test run configuration for a local SmartDevice test run.
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Multiple2/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using System.Text;
4 |
5 | class Example
6 | {
7 | static void Main(string[] args)
8 | {
9 | FileTarget target = new FileTarget();
10 | target.Layout = "${longdate} ${logger} ${message}";
11 | target.FileName = "${basedir}/${shortdate}/${windows-identity:domain=false}.${level}.log";
12 | target.KeepFileOpen = false;
13 | target.Encoding = Encoding.UTF8;
14 |
15 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
16 |
17 | Logger logger = LogManager.GetLogger("Example");
18 | logger.Debug("log message");
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Chainsaw/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 |
4 | class Example
5 | {
6 | static void Main(string[] args)
7 | {
8 | ChainsawTarget target = new ChainsawTarget();
9 | target.Address = "udp://localhost:4000";
10 |
11 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
12 |
13 | Logger logger = LogManager.GetLogger("Example");
14 | logger.Trace("log message 1");
15 | logger.Debug("log message 2");
16 | logger.Info("log message 3");
17 | logger.Warn("log message 4");
18 | logger.Error("log message 5");
19 | logger.Fatal("log message 6");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetTrace/test.aspx:
--------------------------------------------------------------------------------
1 | <%@ Page language="c#" AutoEventWireup="true" %>
2 |
12 |
13 |
14 |
15 |
16 |
17 | Page has been loaded and log events have been registered for display in ASP.NET Trace facility.
18 |
19 |
20 | Click here to view trace output from Trace.axd
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/NLogViewer/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 |
4 | class Example
5 | {
6 | static void Main(string[] args)
7 | {
8 | NLogViewerTarget target = new NLogViewerTarget();
9 | target.Address = "udp://localhost:4000";
10 |
11 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
12 |
13 | Logger logger = LogManager.GetLogger("Example");
14 | logger.Trace("log message 1");
15 | logger.Debug("log message 2");
16 | logger.Info("log message 3");
17 | logger.Warn("log message 4");
18 | logger.Error("log message 5");
19 | logger.Fatal("log message 6");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/AsyncWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/AutoFlushWrapper/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrappers;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget wrappedTarget = new FileTarget();
13 | wrappedTarget.FileName = "${basedir}/file.txt";
14 |
15 | AutoFlushTargetWrapper target = new AutoFlushTargetWrapper();
16 | target.WrappedTarget = wrappedTarget;
17 |
18 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
19 |
20 | Logger logger = LogManager.GetLogger("Example");
21 | logger.Debug("log message");
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Debug/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | DebugTarget target = new DebugTarget();
11 | target.Layout = "${message}";
12 |
13 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
14 |
15 | Logger logger = LogManager.GetLogger("Example");
16 | logger.Debug("log message");
17 | logger.Debug("another log message");
18 |
19 | Console.WriteLine("The debug target has been hit {0} times.", target.Counter);
20 | Console.WriteLine("The last message was '{0}'.", target.LastMessage);
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/ASPNetBufferingWrapper/web.nlog:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Asynchronous/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tests/webtest/bin/NLog.dll.nlog:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetBufferingWrapper/Web.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/PostFilteringWrapper/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/NLogViewerNLogConfig/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RepeatingWrapper/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrappers;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget wrappedTarget = new FileTarget();
13 | wrappedTarget.FileName = "${basedir}/file.txt";
14 |
15 | RepeatingTargetWrapper target = new RepeatingTargetWrapper();
16 | target.WrappedTarget = wrappedTarget;
17 | target.RepeatCount = 3;
18 |
19 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
20 |
21 | Logger logger = LogManager.GetLogger("Example");
22 | logger.Debug("log message");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/BufferingWrapper/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrappers;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget wrappedTarget = new FileTarget();
13 | wrappedTarget.FileName = "${basedir}/file.txt";
14 |
15 | BufferingTargetWrapper target = new BufferingTargetWrapper();
16 | target.BufferSize = 100;
17 | target.WrappedTarget = wrappedTarget;
18 |
19 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
20 |
21 | Logger logger = LogManager.GetLogger("Example");
22 | logger.Debug("log message");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/CSV/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/web/NLogCdef.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // TCHAR macros
3 | //
4 | #ifdef UNICODE
5 |
6 | #define NLog_Log NLog_LogW
7 | #define NLog_LogV NLog_LogVW
8 | #define NLog_Trace NLog_TraceW
9 | #define NLog_Debug NLog_DebugW
10 | #define NLog_Info NLog_InfoW
11 | #define NLog_Warn NLog_WarnW
12 | #define NLog_Error NLog_ErrorW
13 | #define NLog_Fatal NLog_FatalW
14 | #define NLog_ConfigureFromFile NLog_ConfigureFromFileW
15 |
16 | #else
17 |
18 | #define NLog_Log NLog_LogA
19 | #define NLog_LogV NLog_LogVA
20 | #define NLog_Trace NLog_TraceA
21 | #define NLog_Debug NLog_DebugA
22 | #define NLog_Info NLog_InfoA
23 | #define NLog_Warn NLog_WarnA
24 | #define NLog_Error NLog_ErrorA
25 | #define NLog_Fatal NLog_FatalA
26 | #define NLog_ConfigureFromFile NLog_ConfigureFromFileA
27 |
28 | #endif
29 |
--------------------------------------------------------------------------------
/examples/web/MyFirstTarget.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 |
3 | namespace MyNamespace
4 | {
5 | [Target("MyFirst")]
6 | public sealed class MyFirstTarget: TargetWithLayout
7 | {
8 | private string _host = "localhost";
9 |
10 | public string Host
11 | {
12 | get { return _host; }
13 | set { _host = value; }
14 | }
15 |
16 | protected override void Write(LogEventInfo logEvent)
17 | {
18 | string logMessage = CompiledLayout.GetFormattedMessage(logEvent);
19 |
20 | SendTheMessageToRemoteHost(this.Host, logMessage);
21 | }
22 |
23 | private void SendTheMessageToRemoteHost(string host, string message)
24 | {
25 | // TODO - write me
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ColoredConsole/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Win32.Targets;
3 |
4 | class Example
5 | {
6 | static void Main(string[] args)
7 | {
8 | ColoredConsoleTarget target = new ColoredConsoleTarget();
9 | target.Layout = "${date:format=HH\\:MM\\:ss} ${logger} ${message}";
10 |
11 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Trace);
12 |
13 | Logger logger = LogManager.GetLogger("Example");
14 | logger.Trace("trace log message");
15 | logger.Debug("debug log message");
16 | logger.Info("info log message");
17 | logger.Warn("warn log message");
18 | logger.Error("error log message");
19 | logger.Fatal("fatal log message");
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Network/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 |
4 | class Example
5 | {
6 | static void Main(string[] args)
7 | {
8 | NetworkTarget target = new NetworkTarget();
9 | target.Layout = "${level} ${logger} ${message}${newline}";
10 | target.Address = "tcp://localhost:5555";
11 |
12 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
13 |
14 | Logger logger = LogManager.GetLogger("Example");
15 | logger.Trace("log message 1");
16 | logger.Debug("log message 2");
17 | logger.Info("log message 3");
18 | logger.Warn("log message 4");
19 | logger.Error("log message 5");
20 | logger.Fatal("log message 6");
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/ColoredConsole/Row Highlighting/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Archive2/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/PerfCounter/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Win32.Targets;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | PerfCounterTarget target = new PerfCounterTarget();
13 | target.AutoCreate = true;
14 | target.CategoryName = "My category";
15 | target.CounterName = "My counter";
16 | target.CounterType = PerformanceCounterType.NumberOfItems32;
17 | target.InstanceName = "My instance";
18 |
19 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
20 |
21 | Logger logger = LogManager.GetLogger("Example");
22 | logger.Debug("log message");
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Archive1/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/NuGet/NLog.Config/content/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
9 |
10 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/WebService/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/VSIntegration/Snippets/VBLogger.snippet:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Add NLog Logger to a class
6 | NLog Project
7 | Add Logger creation statement to a class.
8 | nlogger
9 |
10 | Expansion
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RetryingWrapper/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrappers;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget wrappedTarget = new FileTarget();
13 | wrappedTarget.FileName = "${basedir}/file.txt";
14 |
15 | RetryingTargetWrapper target = new RetryingTargetWrapper();
16 | target.WrappedTarget = wrappedTarget;
17 | target.RetryCount = 3;
18 | target.RetryDelayMilliseconds = 1000;
19 |
20 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
21 |
22 | Logger logger = LogManager.GetLogger("Example");
23 | logger.Debug("log message");
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/web/config4.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/SplitGroup/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrapper;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget file1 = new FileTarget();
13 | file1.FileName = "${basedir}/file1.txt";
14 |
15 | FileTarget file2 = new FileTarget();
16 | file2.FileName = "${basedir}/file2.txt";
17 |
18 | SplitTarget target = new SplitTarget();
19 | target.Targets.Add(file1);
20 | target.Targets.Add(file2);
21 |
22 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
23 |
24 | Logger logger = LogManager.GetLogger("Example");
25 | logger.Debug("log message");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RandomizeGroup/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Compound;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget file1 = new FileTarget();
13 | file1.FileName = "${basedir}/file1.txt";
14 |
15 | FileTarget file2 = new FileTarget();
16 | file2.FileName = "${basedir}/file2.txt";
17 |
18 | RandomizeTarget target = new RandomizeTarget();
19 | target.Targets.Add(file1);
20 | target.Targets.Add(file2);
21 |
22 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
23 |
24 | Logger logger = LogManager.GetLogger("Example");
25 | logger.Debug("log message");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RoundRobinGroup/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Compound;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget file1 = new FileTarget();
13 | file1.FileName = "${basedir}/file1.txt";
14 |
15 | FileTarget file2 = new FileTarget();
16 | file2.FileName = "${basedir}/file2.txt";
17 |
18 | RoundRobinTarget target = new RoundRobinTarget();
19 | target.Targets.Add(file1);
20 | target.Targets.Add(file2);
21 |
22 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
23 |
24 | Logger logger = LogManager.GetLogger("Example");
25 | logger.Debug("log message");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/EmptyNLogConfig/MyTemplate.vstemplate:
--------------------------------------------------------------------------------
1 |
2 |
3 | NLog.config
4 | Empty NLog Configuration File
5 | Empty NLog configuration file
6 | $projecttype$
7 | $projectsubtype$
8 | 10
9 | __TemplateIcon.ico
10 |
11 |
12 |
13 |
14 | NLog
15 |
16 |
17 | NLog.config
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/WebService/WebService1/Service1.asmx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Web;
4 | using System.Collections;
5 | using System.Web.Services;
6 | using System.Web.Services.Protocols;
7 | using System.ComponentModel;
8 |
9 | namespace WebService1
10 | {
11 | [WebService(Namespace = "http://www.nlog-project.org/example")]
12 | [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
13 | [ToolboxItem(false)]
14 | public class Service1 : System.Web.Services.WebService
15 | {
16 | [WebMethod]
17 | public void HelloWorld(string n1, string n2, string n3)
18 | {
19 | HttpContext.Current.Trace.Write("n1 " + n1);
20 | HttpContext.Current.Trace.Write("n2 " + n2);
21 | HttpContext.Current.Trace.Write("n3 " + n3);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/Database/MSSQL/create_nlog_database.sql:
--------------------------------------------------------------------------------
1 | use master;
2 | go
3 |
4 | create database NLogDatabase
5 | /*
6 | on primary (name='NLogDatabase
7 | filename='***insert_path_here***\NLogDatabase.mdf',
8 | size=10MB)
9 | log on (name='NLogDatabase_log',
10 | filename='***insert_path_here***\NLogDatabase_log.ldf',
11 | size=10MB)
12 | */
13 | go
14 |
15 | exec sp_addlogin 'nloguser','nlogpassword',NLogDatabase
16 | go
17 |
18 | use NLogDatabase;
19 | go
20 |
21 | create table LogTable
22 | (
23 | sequence_id integer not null primary key identity(1,1),
24 | time_stamp datetime not null,
25 | level varchar(5) not null,
26 | logger varchar(80) not null,
27 | message varchar(4095) not null,
28 | )
29 | go
30 |
31 | exec sp_grantdbaccess 'nloguser','nloguser'
32 | go
33 |
34 | grant insert,select on LogTable to nloguser
35 | go
36 |
--------------------------------------------------------------------------------
/src/Docs/Frameworks/Silverlight 3.0.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(ProgramFiles)\Reference Assemblies\Microsoft\Framework\Silverlight\v3.0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Docs/Frameworks/Silverlight 4.0.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(ProgramFiles)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/WebService/Simple/WebService1/Service1.asmx.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Data;
3 | using System.Web;
4 | using System.Collections;
5 | using System.Web.Services;
6 | using System.Web.Services.Protocols;
7 | using System.ComponentModel;
8 |
9 | namespace WebService1
10 | {
11 | [WebService(Namespace = "http://www.nlog-project.org/example")]
12 | [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
13 | [ToolboxItem(false)]
14 | public class Service1 : System.Web.Services.WebService
15 | {
16 | [WebMethod]
17 | public void HelloWorld(string n1, string n2, string n3)
18 | {
19 | HttpContext.Current.Trace.Write("n1 " + n1);
20 | HttpContext.Current.Trace.Write("n2 " + n2);
21 | HttpContext.Current.Trace.Write("n3 " + n3);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Archive3/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/FileNLogConfig/MyTemplate.vstemplate:
--------------------------------------------------------------------------------
1 |
2 |
3 | NLog.config
4 | NLog Configuration - File
5 | NLog configuration file for File logging
6 | $projecttype$
7 | $projectsubtype$
8 | 10
9 | __TemplateIcon.ico
10 |
11 |
12 |
13 |
14 | NLog
15 |
16 |
17 | NLog.config
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/ConsoleNLogConfig/MyTemplate.vstemplate:
--------------------------------------------------------------------------------
1 |
2 |
3 | NLog.config
4 | NLog Configuration - Console
5 | NLog configuration file for Console logging
6 | $projecttype$
7 | $projectsubtype$
8 | 10
9 | __TemplateIcon.ico
10 |
11 |
12 |
13 |
14 | NLog
15 |
16 |
17 | NLog.config
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetTrace/Global.asax.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Web;
3 |
4 | using NLog;
5 | using NLog.Targets;
6 |
7 | namespace SomeWebApplication
8 | {
9 | public class Global : System.Web.HttpApplication
10 | {
11 | //
12 | // this event handler is executed at the very start of the web application
13 | // so this is a good place to configure targets programmatically
14 | //
15 | // alternative you could place this code in a static type constructor
16 | //
17 | protected void Application_Start(Object sender, EventArgs e)
18 | {
19 | ASPNetTraceTarget target = new ASPNetTraceTarget();
20 | target.Layout = "${logger} ${message}";
21 |
22 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/File/Archive4/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/examples/web/config6.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Template.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_PROJECT_NAME_", "_PROJECT_NAME_.csproj", "{_PROJECT_GUID_}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {_PROJECT_GUID_}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {_PROJECT_GUID_}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {_PROJECT_GUID_}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {_PROJECT_GUID_}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/src/Docs/Frameworks/.NET Compact Framework 2.0.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework\v2.0.0.0\InstallRoot)
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/Docs/Frameworks/.NET Compact Framework 3.5.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETCompactFramework\v3.5.0.0\InstallRoot)
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/LogReceiverNLogConfig/MyTemplate.vstemplate:
--------------------------------------------------------------------------------
1 |
2 |
3 | NLog.config
4 | NLog Configuration - LogReceiverService
5 | NLog configuration file for sending logs to LogReceiverService
6 | $projecttype$
7 | $projectsubtype$
8 | 10
9 | __TemplateIcon.ico
10 |
11 |
12 |
13 |
14 | NLog
15 |
16 |
17 | NLog.config
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tools/RunXap/RunXap.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RunXap", "RunXap.csproj", "{0E5F01FB-F76F-48C0-BEB0-4AA25FF02F86}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|x86 = Debug|x86
9 | Release|x86 = Release|x86
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {0E5F01FB-F76F-48C0-BEB0-4AA25FF02F86}.Debug|x86.ActiveCfg = Debug|x86
13 | {0E5F01FB-F76F-48C0-BEB0-4AA25FF02F86}.Debug|x86.Build.0 = Debug|x86
14 | {0E5F01FB-F76F-48C0-BEB0-4AA25FF02F86}.Release|x86.ActiveCfg = Release|x86
15 | {0E5F01FB-F76F-48C0-BEB0-4AA25FF02F86}.Release|x86.Build.0 = Release|x86
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/NLogViewerNLogConfig/MyTemplate.vstemplate:
--------------------------------------------------------------------------------
1 |
2 |
3 | NLog.config
4 | NLog Configuration - Remote Log Viewer (log4j,log4net)
5 | NLog configuration file for sending logs to remote log viewer
6 | $projecttype$
7 | $projectsubtype$
8 | 10
9 | __TemplateIcon.ico
10 |
11 |
12 |
13 |
14 | NLog
15 |
16 |
17 | NLog.config
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/web/MyFirstFilter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | using NLog;
5 |
6 | namespace MyNamespace
7 | {
8 | [Filter("hourRange")]
9 | public sealed class HourRangeFilter: Filter
10 | {
11 | private int _fromHour = 0;
12 | private int _toHour = -1;
13 |
14 | public int FromHour
15 | {
16 | get { return _fromHour; }
17 | set { _fromHour = value; }
18 |
19 | }
20 | public int ToHour
21 | {
22 | get { return _toHour; }
23 | set { _toHour = value; }
24 |
25 | }
26 |
27 | protected override FilterResult Check(LogEventInfo ev)
28 | {
29 | if (ev.TimeStamp.Hour >= FromHour && ev.TimeStamp.Hour <= ToHour)
30 | return Result;
31 | else
32 | return FilterResult.Neutral;
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp.Web/Default.aspx.designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.42
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace NLogSilverlightApp.Web
12 | {
13 |
14 |
15 | public partial class _Default
16 | {
17 |
18 | ///
19 | /// form1 control.
20 | ///
21 | ///
22 | /// Auto-generated field.
23 | /// To modify move field declaration from designer file to code-behind file.
24 | ///
25 | protected global::System.Web.UI.HtmlControls.HtmlForm form1;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/NLogWindowsPhoneApplication/App.xaml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/web/config3.nlog:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Asynchronous/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using NLog.Targets.Wrappers;
4 | using System.Text;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | FileTarget target = new FileTarget();
11 | target.Layout = "${longdate} ${logger} ${message}";
12 | target.FileName = "${basedir}/logs/logfile.txt";
13 | target.KeepFileOpen = false;
14 | target.Encoding = Encoding.UTF8;
15 |
16 | AsyncTargetWrapper wrapper = new AsyncTargetWrapper();
17 | wrapper.WrappedTarget = target;
18 | wrapper.QueueLimit = 5000;
19 | wrapper.OverflowAction = AsyncTargetWrapperOverflowAction.Discard;
20 |
21 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(wrapper, LogLevel.Debug);
22 |
23 | Logger logger = LogManager.GetLogger("Example");
24 | logger.Debug("log message");
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/examples/NLogSilverlightApp/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | namespace NLogSilverlightApp
2 | {
3 | using System.Windows;
4 | using System.Windows.Controls;
5 | using System.Windows.Input;
6 |
7 | using NLog;
8 |
9 | public partial class MainPage : UserControl
10 | {
11 | private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();
12 |
13 | public MainPage()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void Button_Click(object sender, RoutedEventArgs e)
19 | {
20 | logger.Info("Button clicked.");
21 | }
22 |
23 | private void UserControl_Loaded(object sender, RoutedEventArgs e)
24 | {
25 | logger.Info("Form Loaded...");
26 | }
27 |
28 | private void UserControl_KeyDown(object sender, KeyEventArgs e)
29 | {
30 | logger.Info("Key down: {0}", e.Key);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Docs/Frameworks/Silverlight 2.0.shfbproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Silverlight\v2.0\Install Path@Install Path)
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/FilteringWrapper/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Wrappers;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget wrappedTarget = new FileTarget();
13 | wrappedTarget.FileName = "${basedir}/file.txt";
14 |
15 | FilteringTargetWrapper filteringTarget = new FilteringTargetWrapper();
16 | filteringTarget.WrappedTarget = wrappedTarget;
17 |
18 | filteringTarget.Condition = "contains('${message}','1')";
19 |
20 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(filteringTarget, LogLevel.Debug);
21 |
22 | Logger logger = LogManager.GetLogger("Example");
23 | logger.Debug("log message 0");
24 | logger.Debug("log message 1");
25 | logger.Debug("log message 2");
26 | logger.Debug("log message 11");
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/tools/Installer/NLogWix.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogWix", "NLogWix.csproj", "{29A2AFE4-D577-47A9-8FA1-E1CFB4D82F02}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {29A2AFE4-D577-47A9-8FA1-E1CFB4D82F02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {29A2AFE4-D577-47A9-8FA1-E1CFB4D82F02}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {29A2AFE4-D577-47A9-8FA1-E1CFB4D82F02}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {29A2AFE4-D577-47A9-8FA1-E1CFB4D82F02}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/MethodCall/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using System.Diagnostics;
6 |
7 | public class Example
8 | {
9 | public static void LogMethod(string level, string message)
10 | {
11 | Console.WriteLine("l: {0} m: {1}", level, message);
12 | }
13 | static void Main(string[] args)
14 | {
15 | MethodCallTarget target = new MethodCallTarget();
16 | target.ClassName = typeof(Example).AssemblyQualifiedName;
17 | target.MethodName = "LogMethod";
18 | target.Parameters.Add(new MethodCallParameter("${level}"));
19 | target.Parameters.Add(new MethodCallParameter("${message}"));
20 |
21 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
22 |
23 | Logger logger = LogManager.GetLogger("Example");
24 | logger.Debug("log message");
25 | logger.Error("error message");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/FallbackGroup/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Targets.Compound;
6 | using System.Diagnostics;
7 |
8 | class Example
9 | {
10 | static void Main(string[] args)
11 | {
12 | FileTarget file1 = new FileTarget();
13 | file1.FileName = "\\\\server1\\share\\file1.txt";
14 |
15 | FileTarget file2 = new FileTarget();
16 | file2.FileName = "\\\\server2\\share\\file1.txt";
17 |
18 |
19 | // write to server1, if it fails switch to server2
20 | FallbackTarget target = new FallbackTarget();
21 |
22 | target.ReturnToFirstOnSuccess = false;
23 | target.Targets.Add(file1);
24 | target.Targets.Add(file2);
25 |
26 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
27 |
28 | Logger logger = LogManager.GetLogger("Example");
29 | logger.Debug("log message");
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/tools/DumpApiXml/DumpApiXml.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpApiXml", "DumpApiXml.csproj", "{773C477E-2626-432D-B959-325B3B146744}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {773C477E-2626-432D-B959-325B3B146744}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {773C477E-2626-432D-B959-325B3B146744}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {773C477E-2626-432D-B959-325B3B146744}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {773C477E-2626-432D-B959-325B3B146744}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/README.rdoc:
--------------------------------------------------------------------------------
1 | = Welcome to NLog
2 |
3 | NLog is a free logging platform for .NET with rich log routing and management
4 | capabilities. It makes it easy to produce and manage high-quality logs for
5 | your application regardless of its size or complexity.
6 |
7 | It can process diagnostic messages emitted from any .NET language, augment
8 | them with contextual information, format them according to your preference
9 | and send them to one or more targets such as file or database.
10 |
11 | .NET, C/C++ and COM interop APIs are supported so that all your application
12 | components including legacy modules written in C++/COM can route their log
13 | messages through a common engine.
14 |
15 | NLog is open source software, licensed under the terms of BSD license.
16 | See LICENSE.txt for details.
17 |
18 | Project Homepage: http://nlog-project.org
19 |
20 | Project RSS Feed: http://nlog-project.org/feed/
21 |
22 | == Latest News:
23 |
24 | http://feeds.feedburner.com/nlog.2.gif
25 |
--------------------------------------------------------------------------------
/tools/MakeNLogXSD/MakeNLogXSD.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MakeNLogXSD", "MakeNLogXSD.csproj", "{BB32EC17-234D-477D-AC37-96EB19A52018}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {BB32EC17-234D-477D-AC37-96EB19A52018}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {BB32EC17-234D-477D-AC37-96EB19A52018}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {BB32EC17-234D-477D-AC37-96EB19A52018}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {BB32EC17-234D-477D-AC37-96EB19A52018}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/tools/MergeApiXml/MergeApiXml.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MergeApiXml", "MergeApiXml.csproj", "{0452D914-32DD-4C6D-8E13-778657567949}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {0452D914-32DD-4C6D-8E13-778657567949}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {0452D914-32DD-4C6D-8E13-778657567949}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {0452D914-32DD-4C6D-8E13-778657567949}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {0452D914-32DD-4C6D-8E13-778657567949}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/AsyncWrapper/Wrapping File/Example.cs:
--------------------------------------------------------------------------------
1 | using NLog;
2 | using NLog.Targets;
3 | using NLog.Targets.Wrappers;
4 | using System.Text;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | FileTarget target = new FileTarget();
11 | target.Layout = "${longdate} ${logger} ${message}";
12 | target.FileName = "${basedir}/logs/logfile.txt";
13 | target.KeepFileOpen = false;
14 | target.Encoding = Encoding.UTF8;
15 |
16 | AsyncTargetWrapper wrapper = new AsyncTargetWrapper();
17 | wrapper.WrappedTarget = target;
18 | wrapper.QueueLimit = 5000;
19 | wrapper.OverflowAction = AsyncTargetWrapperOverflowAction.Discard;
20 |
21 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(wrapper, LogLevel.Debug);
22 |
23 | Logger logger = LogManager.GetLogger("Example");
24 | logger.Debug("log message");
25 |
26 | wrapper.Flush();
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/src/VSIntegration/ItemTemplatesGenerator/LogReceiverNLogConfig/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Debug/Simple/Debug.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debug", "Debug.csproj", "{D0526912-F1E9-4D30-941F-3A229DCC9309}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D0526912-F1E9-4D30-941F-3A229DCC9309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {D0526912-F1E9-4D30-941F-3A229DCC9309}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {D0526912-F1E9-4D30-941F-3A229DCC9309}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {D0526912-F1E9-4D30-941F-3A229DCC9309}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Simple/File.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File", "File.csproj", "{22DFBCFD-BDC3-4CD1-8DE5-E6872ACF7DB0}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {22DFBCFD-BDC3-4CD1-8DE5-E6872ACF7DB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {22DFBCFD-BDC3-4CD1-8DE5-E6872ACF7DB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {22DFBCFD-BDC3-4CD1-8DE5-E6872ACF7DB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {22DFBCFD-BDC3-4CD1-8DE5-E6872ACF7DB0}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/MSMQ/Simple/MSMQ.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSMQ", "MSMQ.csproj", "{5D70009B-698D-4A42-99F8-6C4CEE500AD8}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {5D70009B-698D-4A42-99F8-6C4CEE500AD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {5D70009B-698D-4A42-99F8-6C4CEE500AD8}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {5D70009B-698D-4A42-99F8-6C4CEE500AD8}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {5D70009B-698D-4A42-99F8-6C4CEE500AD8}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Mail/Simple/Mail.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mail", "Mail.csproj", "{4132306C-EA25-4073-BFD5-BEBD9A88B600}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4132306C-EA25-4073-BFD5-BEBD9A88B600}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4132306C-EA25-4073-BFD5-BEBD9A88B600}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4132306C-EA25-4073-BFD5-BEBD9A88B600}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4132306C-EA25-4073-BFD5-BEBD9A88B600}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Null/Simple/Null.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Null", "Null.csproj", "{D32BF09E-4214-42B3-AB66-C6CAE9C3CEB1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D32BF09E-4214-42B3-AB66-C6CAE9C3CEB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {D32BF09E-4214-42B3-AB66-C6CAE9C3CEB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {D32BF09E-4214-42B3-AB66-C6CAE9C3CEB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {D32BF09E-4214-42B3-AB66-C6CAE9C3CEB1}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Trace/Simple/Trace.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trace", "Trace.csproj", "{DE02AB34-33D1-42CA-A3F0-68F4B1BF98B1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {DE02AB34-33D1-42CA-A3F0-68F4B1BF98B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {DE02AB34-33D1-42CA-A3F0-68F4B1BF98B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {DE02AB34-33D1-42CA-A3F0-68F4B1BF98B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {DE02AB34-33D1-42CA-A3F0-68F4B1BF98B1}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/tools/BuildDocPages/BuildDocPages.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 11.00
3 | # Visual Studio 2010
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuildDocPages", "BuildDocPages.csproj", "{5B8E9C8C-725B-492A-9553-493D6990990D}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {5B8E9C8C-725B-492A-9553-493D6990990D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {5B8E9C8C-725B-492A-9553-493D6990990D}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {5B8E9C8C-725B-492A-9553-493D6990990D}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {5B8E9C8C-725B-492A-9553-493D6990990D}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/CSV/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 | using NLog.Layouts;
6 |
7 | class Example
8 | {
9 | static void Main(string[] args)
10 | {
11 | FileTarget target = new FileTarget();
12 | target.FileName = "${basedir}/file.csv";
13 |
14 | CsvLayout layout = new CsvLayout();
15 |
16 | layout.Columns.Add(new CsvColumn("time", "${longdate}"));
17 | layout.Columns.Add(new CsvColumn("message", "${message}"));
18 | layout.Columns.Add(new CsvColumn("logger", "${logger}"));
19 | layout.Columns.Add(new CsvColumn("level", "${level}"));
20 |
21 | target.Layout = layout;
22 |
23 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
24 |
25 | Logger logger = LogManager.GetLogger("Example");
26 | logger.Debug("log message");
27 | logger.Debug("Message with \"quotes\" and \nnew line characters.");
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/CSV/File.CSV.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.CSV", "File.CSV.csproj", "{B55FBAF5-21E0-4375-8515-0FF9622D581E}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {B55FBAF5-21E0-4375-8515-0FF9622D581E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {B55FBAF5-21E0-4375-8515-0FF9622D581E}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {B55FBAF5-21E0-4375-8515-0FF9622D581E}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {B55FBAF5-21E0-4375-8515-0FF9622D581E}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Memory/Simple/Memory.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Memory", "Memory.csproj", "{4D71290B-65DC-4442-BE06-1CEBE07A26AC}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4D71290B-65DC-4442-BE06-1CEBE07A26AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4D71290B-65DC-4442-BE06-1CEBE07A26AC}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4D71290B-65DC-4442-BE06-1CEBE07A26AC}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4D71290B-65DC-4442-BE06-1CEBE07A26AC}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Console/Simple/Console.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Console", "Console.csproj", "{53FFA3C4-C63B-465C-AB3E-E4C3B0953AB1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {53FFA3C4-C63B-465C-AB3E-E4C3B0953AB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {53FFA3C4-C63B-465C-AB3E-E4C3B0953AB1}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {53FFA3C4-C63B-465C-AB3E-E4C3B0953AB1}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {53FFA3C4-C63B-465C-AB3E-E4C3B0953AB1}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Network/Simple/Network.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Network", "Network.csproj", "{1D3835B8-779E-4053-B03E-AC5292A48FF0}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {1D3835B8-779E-4053-B03E-AC5292A48FF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {1D3835B8-779E-4053-B03E-AC5292A48FF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {1D3835B8-779E-4053-B03E-AC5292A48FF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {1D3835B8-779E-4053-B03E-AC5292A48FF0}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/tests/SilverlightApp/NLog.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Chainsaw/Simple/Chainsaw.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chainsaw", "Chainsaw.csproj", "{D7B11859-2A1B-49F7-A7C7-83B72495BF31}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D7B11859-2A1B-49F7-A7C7-83B72495BF31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {D7B11859-2A1B-49F7-A7C7-83B72495BF31}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {D7B11859-2A1B-49F7-A7C7-83B72495BF31}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {D7B11859-2A1B-49F7-A7C7-83B72495BF31}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Debugger/Simple/Debugger.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Debugger", "Debugger.csproj", "{7720B322-2AFF-45C4-AF9A-EAB12BCFAFCE}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {7720B322-2AFF-45C4-AF9A-EAB12BCFAFCE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {7720B322-2AFF-45C4-AF9A-EAB12BCFAFCE}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {7720B322-2AFF-45C4-AF9A-EAB12BCFAFCE}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {7720B322-2AFF-45C4-AF9A-EAB12BCFAFCE}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/EventLog/Simple/EventLog.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventLog", "EventLog.csproj", "{D7347273-CF36-4A75-B324-90D4644D9287}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D7347273-CF36-4A75-B324-90D4644D9287}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {D7347273-CF36-4A75-B324-90D4644D9287}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {D7347273-CF36-4A75-B324-90D4644D9287}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {D7347273-CF36-4A75-B324-90D4644D9287}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/ExtendingLoggers/LoggerWrapper/LoggerWrapper.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoggerWrapper", "LoggerWrapper.csproj", "{B8526875-5F24-4225-A93D-B4FE6099F616}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {B8526875-5F24-4225-A93D-B4FE6099F616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {B8526875-5F24-4225-A93D-B4FE6099F616}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {B8526875-5F24-4225-A93D-B4FE6099F616}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {B8526875-5F24-4225-A93D-B4FE6099F616}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/FormControl/FormControl.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormControl", "FormControl.csproj", "{20449142-40C3-4B1D-8F7C-2D3ED924FDA7}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/MessageBox/Simple/MessageBox.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MessageBox", "MessageBox.csproj", "{26FC5FD6-F4E9-4E0F-BB0D-492AAE98D880}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {26FC5FD6-F4E9-4E0F-BB0D-492AAE98D880}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {26FC5FD6-F4E9-4E0F-BB0D-492AAE98D880}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {26FC5FD6-F4E9-4E0F-BB0D-492AAE98D880}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {26FC5FD6-F4E9-4E0F-BB0D-492AAE98D880}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/MethodCall/Simple/MethodCall.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MethodCall", "MethodCall.csproj", "{8D851E55-9D32-4C20-A9CE-C1A35175D06E}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {8D851E55-9D32-4C20-A9CE-C1A35175D06E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {8D851E55-9D32-4C20-A9CE-C1A35175D06E}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {8D851E55-9D32-4C20-A9CE-C1A35175D06E}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {8D851E55-9D32-4C20-A9CE-C1A35175D06E}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/NLogViewer/Simple/NLogViewer.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogViewer", "NLogViewer.csproj", "{36E8A9EF-C91F-443A-9FEF-B2AB27E3628A}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {36E8A9EF-C91F-443A-9FEF-B2AB27E3628A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {36E8A9EF-C91F-443A-9FEF-B2AB27E3628A}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {36E8A9EF-C91F-443A-9FEF-B2AB27E3628A}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {36E8A9EF-C91F-443A-9FEF-B2AB27E3628A}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/SplitGroup/Simple/SplitGroup.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SplitGroup", "SplitGroup.csproj", "{6C8815D6-62F5-4DED-AE3F-0AF4D0178CDB}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {6C8815D6-62F5-4DED-AE3F-0AF4D0178CDB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {6C8815D6-62F5-4DED-AE3F-0AF4D0178CDB}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {6C8815D6-62F5-4DED-AE3F-0AF4D0178CDB}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {6C8815D6-62F5-4DED-AE3F-0AF4D0178CDB}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Archive1/File.Archive1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Archive1", "File.Archive1.csproj", "{D8A33DCE-395C-4AD8-8FEC-74B8C8C74F53}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {D8A33DCE-395C-4AD8-8FEC-74B8C8C74F53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {D8A33DCE-395C-4AD8-8FEC-74B8C8C74F53}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {D8A33DCE-395C-4AD8-8FEC-74B8C8C74F53}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {D8A33DCE-395C-4AD8-8FEC-74B8C8C74F53}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Archive2/File.Archive2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Archive2", "File.Archive2.csproj", "{97DA6A8F-CF90-4E70-986E-E0A9D7196312}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {97DA6A8F-CF90-4E70-986E-E0A9D7196312}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {97DA6A8F-CF90-4E70-986E-E0A9D7196312}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {97DA6A8F-CF90-4E70-986E-E0A9D7196312}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {97DA6A8F-CF90-4E70-986E-E0A9D7196312}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Archive3/File.Archive3.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Archive3", "File.Archive3.csproj", "{400AFAB6-9354-49AB-A001-00B09235CEF1}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {400AFAB6-9354-49AB-A001-00B09235CEF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {400AFAB6-9354-49AB-A001-00B09235CEF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {400AFAB6-9354-49AB-A001-00B09235CEF1}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {400AFAB6-9354-49AB-A001-00B09235CEF1}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Archive4/File.Archive4.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Archive4", "File.Archive4.csproj", "{F1BC69B4-E41C-4E72-AA57-FBF73663CAEB}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {F1BC69B4-E41C-4E72-AA57-FBF73663CAEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {F1BC69B4-E41C-4E72-AA57-FBF73663CAEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {F1BC69B4-E41C-4E72-AA57-FBF73663CAEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {F1BC69B4-E41C-4E72-AA57-FBF73663CAEB}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Multiple/File.Multiple.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Multiple", "File.Multiple.csproj", "{45DC6DFF-4680-4739-8DD1-3EA91C1E2F19}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {45DC6DFF-4680-4739-8DD1-3EA91C1E2F19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {45DC6DFF-4680-4739-8DD1-3EA91C1E2F19}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {45DC6DFF-4680-4739-8DD1-3EA91C1E2F19}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {45DC6DFF-4680-4739-8DD1-3EA91C1E2F19}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Mail/Buffered/Mail.Buffered.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mail.Buffered", "Mail.Buffered.csproj", "{4D14B05B-437D-4D83-A52E-526DEBF68999}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4D14B05B-437D-4D83-A52E-526DEBF68999}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4D14B05B-437D-4D83-A52E-526DEBF68999}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4D14B05B-437D-4D83-A52E-526DEBF68999}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4D14B05B-437D-4D83-A52E-526DEBF68999}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/PerfCounter/Simple/PerfCounter.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerfCounter", "PerfCounter.csproj", "{4C16C5D0-BB26-4639-8A2A-AEFCE8D3E5D6}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4C16C5D0-BB26-4639-8A2A-AEFCE8D3E5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4C16C5D0-BB26-4639-8A2A-AEFCE8D3E5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4C16C5D0-BB26-4639-8A2A-AEFCE8D3E5D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4C16C5D0-BB26-4639-8A2A-AEFCE8D3E5D6}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/RichTextBox/Simple/RichTextBox.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RichTextBox", "RichTextBox.csproj", "{20449142-40C3-4B1D-8F7C-2D3ED924FDA7}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {20449142-40C3-4B1D-8F7C-2D3ED924FDA7}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/ASPNetTrace/ASPNetTraceTest.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASPNetTraceTest", "ASPNetTraceTest.csproj", "{C7BA2451-7027-4838-BD3B-02DC5DCD8CB5}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {C7BA2451-7027-4838-BD3B-02DC5DCD8CB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {C7BA2451-7027-4838-BD3B-02DC5DCD8CB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {C7BA2451-7027-4838-BD3B-02DC5DCD8CB5}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {C7BA2451-7027-4838-BD3B-02DC5DCD8CB5}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Database/MSSQL/Database.MSSQL.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Database.MSSQL", "Database.MSSQL.csproj", "{4399886A-6016-4290-992E-1E77A14CEE46}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {4399886A-6016-4290-992E-1E77A14CEE46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {4399886A-6016-4290-992E-1E77A14CEE46}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {4399886A-6016-4290-992E-1E77A14CEE46}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {4399886A-6016-4290-992E-1E77A14CEE46}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/File/Multiple2/File.Multiple2.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "File.Multiple2", "File.Multiple2.csproj", "{BE090500-80BA-45B8-A22F-114167DCF774}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {BE090500-80BA-45B8-A22F-114167DCF774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {BE090500-80BA-45B8-A22F-114167DCF774}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {BE090500-80BA-45B8-A22F-114167DCF774}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {BE090500-80BA-45B8-A22F-114167DCF774}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/targets/Configuration API/Mail/Simple/Example.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using NLog;
4 | using NLog.Targets;
5 |
6 | class Example
7 | {
8 | static void Main(string[] args)
9 | {
10 | try
11 | {
12 | Console.WriteLine("Setting up the target...");
13 | MailTarget target = new MailTarget();
14 |
15 | target.SmtpServer = "192.168.0.15";
16 | target.From = "jaak@jkowalski.net";
17 | target.To = "jaak@jkowalski.net";
18 | target.Subject = "sample subject";
19 |
20 | NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(target, LogLevel.Debug);
21 |
22 | Console.WriteLine("Sending...");
23 | Logger logger = LogManager.GetLogger("Example");
24 | Console.WriteLine("Sent.");
25 | logger.Debug("log message");
26 | }
27 | catch (Exception ex)
28 | {
29 | Console.WriteLine("EX: {0}", ex);
30 |
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/examples/targets/Configuration File/WebService/WebService1/WebService1.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 9.00
3 | # Visual Studio 2005
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebService1", "WebService1.csproj", "{7E750696-C0EC-4B2C-B870-331A54F25CA4}"
5 | EndProject
6 | Global
7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
8 | Debug|Any CPU = Debug|Any CPU
9 | Release|Any CPU = Release|Any CPU
10 | EndGlobalSection
11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
12 | {7E750696-C0EC-4B2C-B870-331A54F25CA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
13 | {7E750696-C0EC-4B2C-B870-331A54F25CA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
14 | {7E750696-C0EC-4B2C-B870-331A54F25CA4}.Release|Any CPU.ActiveCfg = Release|Any CPU
15 | {7E750696-C0EC-4B2C-B870-331A54F25CA4}.Release|Any CPU.Build.0 = Release|Any CPU
16 | EndGlobalSection
17 | GlobalSection(SolutionProperties) = preSolution
18 | HideSolutionNode = FALSE
19 | EndGlobalSection
20 | EndGlobal
21 |
--------------------------------------------------------------------------------
/examples/web/benchmark_log4net.cs:
--------------------------------------------------------------------------------
1 | #if LOG4NET
2 | ILog logger = LogManager.GetLogger("somelogger");
3 | #else
4 | Logger logger = LogManager.GetLogger("somelogger");
5 | #endif
6 |
7 | // Case 1. No formatting:
8 | logger.Debug("This is a message without formatting.");
9 |
10 | // Case 2. One format parameter
11 | #if LOG4NET
12 | logger.Debug(String.Format("This is a message with {0} format parameter", 1));
13 | #else
14 | logger.Debug("This is a message with {0} format parameter", 1);
15 | #endif
16 |
17 | // Case 3. Two format parameters
18 | #if LOG4NET
19 | logger.Debug(String.Format("This is a message with {0}{1} parameters", 2, "o"));
20 | #else
21 | logger.Debug("This is a message with {0}{1} parameters", 2, "o");
22 | #endif
23 |
24 | // Case 4. Three format parameters
25 | #if LOG4NET
26 | logger.Debug(String.Format("This is a message with {0}{1}{2} parameters", "thr", 3, 3));
27 | #else
28 | logger.Debug("This is a message with {0}{1}{2} parameters", "thr", 3, 3);
29 | #endif
30 |
31 |
--------------------------------------------------------------------------------