diff --git a/.bettercodehub.yml b/.bettercodehub.yml deleted file mode 100644 index f3e187636e..0000000000 --- a/.bettercodehub.yml +++ /dev/null @@ -1,11 +0,0 @@ -exclude: -- /examples/.* -- /src/VSIntegration/.* -- /src/Docs/.* -- /src/NLogAutoLoadExtension/.* -- /src/InstallNLogConfig/.* -- /tests/SampleExtensions/.* -- /tools/.* -component_depth: 3 -languages: -- csharp diff --git a/.editorconfig b/.editorconfig index 5270af24b6..36f9632ce9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,9 +3,15 @@ root = true ; Unix-style newlines [*] -end_of_line = LF +end_of_line = crlf ; 4-column space indentation [*.cs] indent_style = space indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true + +# .NET formatting rules +[*.{cs,vb}] +dotnet_sort_system_directives_first = true \ No newline at end of file diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 0fdc7ca43a..0000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,88 +0,0 @@ -Support & contributing guidelines (September 19, 2017) -=== -Do you have feature requests, questions or would you like to report a bug? Please follow these guidelines when posting on the [issue list](https://github.com/NLog/NLog/issues). The issues are labeled with the [following guideline](/issue-labeling.md). - -Feature requests ----- -Please provide the following information: -- The current NLog version -- Any current work-arounds -- Example of the config when implemented. Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). -- Pull requests and unit tests are welcome! - -Questions ----- -Please provide the following information: -- The current NLog version -- The current config (file content or API calls). Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). -- If relevant: the current result -- If relevant: the expected result - - - -Bug reports ----- -Please provide the following information: -- The current NLog version -- The error message and stacktrace. Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). -- The internal log, `Debug` level. See [Internal Logging](https://github.com/NLog/NLog/wiki/Internal-Logging) -- The current result -- The expected result -- Any current work-arounds -- The current config (file content or API calls). Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). -- Pull requests and unit tests are welcome! - - - -Pull requests ----- -Unit tests are really appreciated! - -Please document any public method and property. Document **why** and not how. At least required: - -* Method: Summary, param and return. -* Property: Summary - - -Multiple .NET versions -=== -Keep in mind that multiple versions of .NET are supported. Some methods are not available in all .NET versions. The following conditional compilation symbols can be used: - -``` -#if NET3_5 -#if NET4_0 -#if NET4_5 -#if SILVERLIGHT -#if SILVERLIGHT5 -#if MONO -#if MONO_2_0 -#if WINDOWS_PHONE -#if WINDOWS_PHONE_7 -#if WINDOWS_PHONE_7_1 -#if __IOS__ -#if __ANDROID__ -``` - -Update your fork -=== -Is your fork not up-to-date with the NLog code? Most of the time that isn't a problem. But if you like to "sync back" the changes to your repository, execute the following command: - -The first time: -``` -git remote add upstream https://github.com/NLog/NLog.git -``` - - -After that you repository will have two remotes. You could update your remote (the fork) in the following way: - -``` -git fetch upstream -git checkout -git rebase upstream/master -..fix if needed and -git push -f -``` - -if `rebase` won't work well, use `git merge master` as alternative. - -It's also possible to send a PR in the opposite direction, but that's not preferred as it will pollute the commit log. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 7e3e9fb3b6..0918c860e4 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,20 +1,16 @@ --- name: Bug report -about: Create a report to help us improve +about: Report any issues found in NLog functionality or source-code to help us improve --- -Hi! Thanks for reporting this feature/bug/question! +Hi! Thanks for reporting this bug! Please keep / fill in the relevant info from this template so that we can help you as best as possible. -QUESTIONS are preferred on StackOverflow. You could expect a faster response there (but do include all the info below). Use the tag "nlog" https://stackoverflow.com/questions/ask +**NLog version**: (e.g. 4.7.15) -For .NET Core users, please check the platform support: https://github.com/NLog/NLog/wiki/platform-support - -**NLog version**: (e.g. 4.4.13) - -**Platform**: .Net 3.5 / .Net 4.0 / .Net 4.5 / Mono 4 / Silverlight 4 / Silverlight 5 / Xamarin Android / Xamarin iOs / .NET Core 1 / .NET Core 2 +**Platform**: .NET8 / .NET Framework 4.8 / Linux / Android / iOS / UWP / Unity / etc. **Current NLog config** (xml or C#, if relevant) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000000..da68c92a3e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Have a question ❓ + url: https://stackoverflow.com/tags/nlog + about: Use the NLog-tag when asking questions at StackOverflow.com \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 694a4168d8..362a620476 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -4,18 +4,13 @@ about: Suggest an idea for this project --- -Hi! Thanks for reporting this feature/bug/question! +Hi! Thanks for reporting this feature! Please keep / fill in the relevant info from this template so that we can help you as best as possible. -QUESTIONS are preferred on StackOverflow. You could expect a faster response there (but do include all the info below). Use the tag "nlog" https://stackoverflow.com/questions/ask +**NLog version**: (e.g. 4.7.15) -For .NET Core users, please check the platform support: https://github.com/NLog/NLog/wiki/platform-support - - -**NLog version**: (e.g. 4.2.3) - -**Platform**: .Net 3.5 / .Net 4.0 / .Net 4.5 / Mono 4 / Silverlight 4 / Silverlight 5 / Xamarin Android / Xamarin iOs / .NET Core 1 / .NET Core 2 +**Platform**: .NET8 / .NET Framework 4.8 / Linux / Android / iOS / UWP / Unity / etc. **Current NLog config** (xml or C#, if relevant) diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..6f6e4ecf9b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: + +- package-ecosystem: nuget + directory: "/tests/NLog.UnitTests" + schedule: + interval: daily + open-pull-requests-limit: 10 + \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f5733b25e9..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ -language: csharp - -mono: 5.8.0 -dotnet: 2.0.0 -dist: bionic - - -install: - - nuget install xunit.runner.console -version 2.2.0 - # workaround for missing .net 4.5 targing pack - - export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/ - # Display dotnet version info - - which dotnet; - if [ $? -eq 0 ]; then - echo "Using dotnet:"; - dotnet --info; - else - echo "dotnet.exe not found" - exit 1; - fi - - # Restore dependencies - - dotnet restore src/NLog - - dotnet restore tests/NLogAutoLoadExtension - - dotnet restore tests/ManuallyLoadedExtension - - - dotnet restore tests/SampleExtensions - - - dotnet restore tests/NLog.UnitTests - -script: - # Run tests - - dotnet test tests/NLog.UnitTests --configuration Release --framework netcoreapp2.0 - - - dotnet msbuild /t:Restore /p:targetframework=net452 /p:monobuild=1 src/NLog - - dotnet msbuild /t:Restore /p:targetframework=net452 /p:monobuild=1 tests/NLog.UnitTests - - dotnet msbuild /t:Rebuild /p:targetframework=net452 /p:configuration=Release /p:monobuild=1 tests/NLog.UnitTests - - mono ./xunit.runner.console.2.2.0/tools/xunit.console.exe "./tests/NLog.UnitTests/bin/Release/net452/NLog.UnitTests.dll" diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9d30e08a..0373a34feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,22 +4,916 @@ Date format: (year/month/day) ## Change Log -### V4.7 - upcomming +### Version 6.1 (2026/01/31) + +**Improvements** +- [#5999](https://github.com/NLog/NLog/pull/5999) JsonLayout - Added support for DottedRecursion. (@thatrajeevkr) +- [#6084](https://github.com/NLog/NLog/pull/6084) JsonLayout - Protect against cyclic object graphs when DottedRecursion. (@snakefoot) +- [#6075](https://github.com/NLog/NLog/pull/6075) DebuggerTarget - Add support for MaxMessageSize and OnOverflow-action. (@snakefoot) +- [#6070](https://github.com/NLog/NLog/pull/6070) InternalLogger - Auto enable LogLevel.Info when activated. (@snakefoot) +- [#6045](https://github.com/NLog/NLog/pull/6045) LoggingConfigurationParser - Report unrecognized options in targets and rules section. (@snakefoot) +- [#6059](https://github.com/NLog/NLog/pull/6059) LogEventBuilder - Properties with IReadOnlyCollection for initialCapacity. (@snakefoot) +- [#6065](https://github.com/NLog/NLog/pull/6065) FileTarget - Adjust ArchiveSuffixFormat to better handle legacy ArchiveFileName. (@snakefoot) +- [#6079](https://github.com/NLog/NLog/pull/6079) FileTarget - Replace Environment.TickCount with LogEventInfo.TimeStamp. (@snakefoot) +- [#6066](https://github.com/NLog/NLog/pull/6066) FileTarget - Simplify FileName natural ordering logic. (@snakefoot) +- [#6069](https://github.com/NLog/NLog/pull/6069) FileTarget - Reduce code complexity for NaturalStringComparer. (@snakefoot) +- [#6064](https://github.com/NLog/NLog/pull/6064) FileTarget - Reduce code complexity for ArchiveNumbering property. (@snakefoot) +- [#6082](https://github.com/NLog/NLog/pull/6082) JsonLayout - Faster Json encoding with INoAllocationStringValueRenderer. (@snakefoot) +- [#6083](https://github.com/NLog/NLog/pull/6083) CsvLayout - Faster CSV encoding with INoAllocationStringValueRenderer. (@snakefoot) +- [#6081](https://github.com/NLog/NLog/pull/6081) DefaultJsonSerializer - Reduce overhead of PerformJsonEscapeWhenNeeded. (@snakefoot) +- [#6025](https://github.com/NLog/NLog/pull/6025) LogEventInfo - Changed LayoutCache from dictionary to linked list. (@snakefoot) +- [#6049](https://github.com/NLog/NLog/pull/6049) PropertiesDictionary - Increase initial capacity when insert. (@snakefoot) +- [#6061](https://github.com/NLog/NLog/pull/6061) PropertiesDictionary - Simplify enumerator when mixing property types. (@snakefoot) +- [#6074](https://github.com/NLog/NLog/pull/6074) WhenEmpty - Optimize when IsFixedText. (@snakefoot) +- [#6062](https://github.com/NLog/NLog/pull/6062) BufferingTargetWrapper - Improve InternalLogger output when WrappedTarget is NULL. (@snakefoot) +- [#6067](https://github.com/NLog/NLog/pull/6067) Fix nullable warnings from NET10 annotations. (@snakefoot) +- [#6068](https://github.com/NLog/NLog/pull/6068) Support nullable where TKey : notnull for dictionary. (@snakefoot) +- [#6071](https://github.com/NLog/NLog/pull/6071) AssemblyExtensionTypes - Reduce code complexity. (@snakefoot) +- [#6072](https://github.com/NLog/NLog/pull/6072) LoggingConfigurationFileLoader - Handle unknown type loading for App.config. (@snakefoot) +- [#6076](https://github.com/NLog/NLog/pull/6076) Marked ConversionHelpers.TryParseEnum as obsolete. (@snakefoot) +- [#5949](https://github.com/NLog/NLog/pull/5949) CallSiteLayoutRenderer - Obsoleted CleanNamesOfAnonymousDelegates + CleanNamesOfAsyncContinuation. (@snakefoot) + +### Version 6.0.7 (2025/12/09) + +**Improvements** +- [#6056](https://github.com/NLog/NLog/pull/6056) FileTarget - Archive Cleanup sort filenames using natural ordering. (@snakefoot) +- [#6054](https://github.com/NLog/NLog/pull/6054) EventProperties - Format Dictionary Properties correctly. (@snakefoot) +- [#6051](https://github.com/NLog/NLog/pull/6051) Failure to create config item should be reported as InternalLogger Error. (@snakefoot) +- [#6052](https://github.com/NLog/NLog/pull/6052) PropertiesDictionary - Faster TryGetValue without IsEmpty. (@snakefoot) +- [#6048](https://github.com/NLog/NLog/pull/6048) PropertiesDictionary - Increase initial capacity when insert. (@snakefoot) +- [#6047](https://github.com/NLog/NLog/pull/6047) LogEventInfo - Minor optimization of HasImmutableProperties. (@snakefoot) +- [#6057](https://github.com/NLog/NLog/pull/6057) WhenEmpty - Support AppDomainFixedOutput optimization. (@snakefoot) +- [#6053](https://github.com/NLog/NLog/pull/6053) JsonAttribute - Reduce code complexity when Encode = false. (@snakefoot) +- [#6044](https://github.com/NLog/NLog/pull/6044) Target also enforce PreventMultipleCalls when WriteFailedNotInitialized. (@snakefoot) +- [#6042](https://github.com/NLog/NLog/pull/6042) NLog.RegEx - Fixed Wiki-link in nuget-package. (@snakefoot) + +### Version 6.0.6 (2025/11/09) + +**Improvements** +- [#6027](https://github.com/NLog/NLog/pull/6027) FileTarget - Improve archive cleanup when using ArchiveSuffixFormat with datetime. (@snakefoot) +- [#6028](https://github.com/NLog/NLog/pull/6028) FileTarget - Fix archive cleanup when only single old file and using MaxArchiveDays. (@snakefoot) +- [#6039](https://github.com/NLog/NLog/pull/6039) FileTarget - Render ArchiveSuffixFormat using NLog DefaultCultureInfo. (@snakefoot) +- [#6030](https://github.com/NLog/NLog/pull/6030) ObjectReflectionCache - Improve handling of JObject serialization. (@snakefoot) +- [#6026](https://github.com/NLog/NLog/pull/6026) JsonLayout - Reduce code complexity for rendering JsonAttribute. (@snakefoot) +- [#6036](https://github.com/NLog/NLog/pull/6036) NullTarget - Improve thread concurrency when FormatMessage = false. (@snakefoot) +- [#6023](https://github.com/NLog/NLog/pull/6023) MemoryTarget - Apply MaxLogsCount limit on next LogEvent. (@snakefoot) +- [#6040](https://github.com/NLog/NLog/pull/6040) XmlParser - Refactor to reduce code complexity. (@snakefoot) +- [#6041](https://github.com/NLog/NLog/pull/6041) ScopeContextAsyncState - Refactor to reduce code complexity. (@snakefoot) + +### Version 6.0.5 (2025/10/09) + +**Improvements** +- [#5998](https://github.com/NLog/NLog/pull/5998) FileTarget - Rolling to next directory should not fail. (@snakefoot) +- [#6013](https://github.com/NLog/NLog/pull/6013) ValueFormatter - Skip quotes for CaptureType.Stringify unless legacy mode. (@snakefoot) +- [#6007](https://github.com/NLog/NLog/pull/6007) ColoredConsoleTarget - Use Span to reduce string-allocation for word-highlighting. (@snakefoot) +- [#6009](https://github.com/NLog/NLog/pull/6009) NullTarget - Avoid string-allocation upfront when FormatMessage = true. (@snakefoot) +- [#6012](https://github.com/NLog/NLog/pull/6012) XmlLoggingConfiguration - Reduce output for InternalLogger Info-Level. (@snakefoot) +- [#6006](https://github.com/NLog/NLog/pull/6006) XmlLoggingConfiguration - Protect against double dispose of AutoReloadConfigFileWatcher. (@snakefoot) +- [#6008](https://github.com/NLog/NLog/pull/6008) LoggerImpl - Merge WriteToTargetWithFilterChain into Write. (@snakefoot) +- [#6010](https://github.com/NLog/NLog/pull/6010) LoggingConfiguration - Redirect AddRuleForOneLevel and AddRuleForAllLevels to AddRule. (@snakefoot) +- [#6011](https://github.com/NLog/NLog/pull/6011) LoggingRule - Align EnableLoggingForLevels to skip when minLevel is LogLevel.Off. (@snakefoot) +- [#6015](https://github.com/NLog/NLog/pull/6015) CompoundLayout - Changed to foreach for better release optimizations. (@snakefoot) +- [#6016](https://github.com/NLog/NLog/pull/6016) CsvLayout - Changed to foreach for better release optimizations. (@snakefoot) +- [#6017](https://github.com/NLog/NLog/pull/6017) JsonArrayLayout - Changed to foreach for better release optimizations. (@snakefoot) +- [#6018](https://github.com/NLog/NLog/pull/6018) XmlLayout - Changed to foreach for better release optimizations. (@snakefoot) + +### Version 6.0.4 (2025/09/11) + +**Improvements** +- [#5979](https://github.com/NLog/NLog/pull/5979) FileTarget - Improve file-wildcard for archive cleanup. (@snakefoot) +- [#5980](https://github.com/NLog/NLog/pull/5980) FileTarget - Extend InternalLogger output with archive cleanup reason. (@snakefoot) +- [#5981](https://github.com/NLog/NLog/pull/5981) FileTarget - Strict wildcard check only possible when single wildcard. (@snakefoot) +- [#5987](https://github.com/NLog/NLog/pull/5987) FileTarget - Improve archive cleanup with dynamic seq-no. (@snakefoot) +- [#5988](https://github.com/NLog/NLog/pull/5988) FileTarget - Avoid parsing archive sequence number when other digits. (@snakefoot) +- [#5996](https://github.com/NLog/NLog/pull/5996) FileTarget - Improve fallback logic when missing file system birthtime. (@snakefoot) +- [#5964](https://github.com/NLog/NLog/pull/5964) ColoredConsoleTarget - WholeWords should only highlight the word. (@snakefoot) +- [#5967](https://github.com/NLog/NLog/pull/5967) ColoredConsoleTarget - Fixed boxing issue in ConsoleRowHighlightingRule. (@karpinsn) +- [#5968](https://github.com/NLog/NLog/pull/5968) Simplify WithAutoFlush-method for fluent config API. (@snakefoot) +- [#5970](https://github.com/NLog/NLog/pull/5970) Fix boxing for registration of builtin condition methods. (@snakefoot) +- [#5977](https://github.com/NLog/NLog/pull/5977) ConditionExpression - Implicit operator with NotNullIfNotNull-attribute. (@GREsau) +- [#5982](https://github.com/NLog/NLog/pull/5982) SimpleLayout - Implicit operator with NotNullIfNotNull-attribute. (@snakefoot) +- [#5992](https://github.com/NLog/NLog/pull/5992) MessageLayoutRenderer - Handle Exception.ToString() can throw with AOT. (@snakefoot) +- [#5983](https://github.com/NLog/NLog/pull/5983) Append4DigitsZeroPadded - Use Span instead of multiple StringBuilder.Append(). (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.WindowsRegistry to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.Trace to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.ConcurrentFile to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.Database to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.Mail to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.WebService to own git repository. (@snakefoot) +- [#5985](https://github.com/NLog/NLog/pull/5985) Extracted NLog.Targets.Network to own git repository. (@snakefoot) + +### Version 6.0.3 (2025/08/10) + +**Improvements** +- [#5952](https://github.com/NLog/NLog/pull/5952) FileTarget - Close old files when reaching OpenFileCacheSize. (@snakefoot) +- [#5948](https://github.com/NLog/NLog/pull/5948) FileTarget - Closing on OpenFileCacheTimeout apply least recently used. (@snakefoot) +- [#5947](https://github.com/NLog/NLog/pull/5947) FileTarget - Improved file-archive exception handling when KeepFileOpen=false. (@snakefoot) +- [#5954](https://github.com/NLog/NLog/pull/5954) ColoredConsoleTarget - Added Words-property for easy highlighting of many words without RegEx. (@snakefoot) +- [#5955](https://github.com/NLog/NLog/pull/5955) LogMessageTemplateFormatter - Also use IValueFormatter for positional templates. (@snakefoot) +- [#5953](https://github.com/NLog/NLog/pull/5953) NLog.Targets.Network - Updated links in README.md for nuget-package. (@snakefoot) +- [#5945](https://github.com/NLog/NLog/pull/5945) NLog.Targets.AtomicFile - Added README.md for nuget-package. (@snakefoot) +- [#5940](https://github.com/NLog/NLog/pull/5940) SplunkTarget - Support SplunkFields-property. (@snakefoot) + +### Version 6.0.2 (2025/07/20) + +**Improvements** + +- [#5930](https://github.com/NLog/NLog/pull/5930) XmlParser - Handle XML comments after root-end-tag. (@snakefoot) +- [#5929](https://github.com/NLog/NLog/pull/5929) XmlLoggingConfiguration - Improve handling of invalid XML. (@snakefoot) +- [#5933](https://github.com/NLog/NLog/pull/5933) Handle invalid message template when skipping parameters array. (@snakefoot) +- [#5915](https://github.com/NLog/NLog/pull/5915) ReplaceNewLinesLayoutRendererWrapper - Replace more line ending characters. (@oikku) +- [#5911](https://github.com/NLog/NLog/pull/5911) NLog.Targets.GZipFile - Improve support for ArchiveAboveSize. (@snakefoot) +- [#5921](https://github.com/NLog/NLog/pull/5921) FileTarget - Activate legacy ArchiveFileName when ArchiveSuffixFormat contains legacy placeholder. (@snakefoot) +- [#5924](https://github.com/NLog/NLog/pull/5924) AsyncTargetWrapper - Updated FullBatchSizeWriteLimit default value from 5 to 10. (@snakefoot) +- [#5937](https://github.com/NLog/NLog/pull/5937) Mark Assembly loading with RequiresUnreferencedCodeAttribute for AOT. (@snakefoot) +- [#5938](https://github.com/NLog/NLog/pull/5938) Logger - Align WriteToTargets with WriteToTargetsWithSpan. (@snakefoot) +- [#5909](https://github.com/NLog/NLog/pull/5909) ConfigurationItemFactory - Added extension hints for webservice and activityid. (@snakefoot) +- [#5918](https://github.com/NLog/NLog/pull/5918) Log4JXmlTarget - Removed alias NLogViewer as conflicts with other nuget-packages. (@snakefoot) +- [#5926](https://github.com/NLog/NLog/pull/5926) SplunkTarget - NetworkTarget with SplunkLayout. (@snakefoot) +- [#5927](https://github.com/NLog/NLog/pull/5927) GelfLayout - Align with SplunkLayout. (@snakefoot) +- [#5913](https://github.com/NLog/NLog/pull/5913) NLog.Targets.Network - Updated nuget-package README.md. (@snakefoot) +- [#5912](https://github.com/NLog/NLog/pull/5912) NLog.Targets.Trace - Updated nuget-package README.md. (@snakefoot) +- [#5919](https://github.com/NLog/NLog/pull/5919) XML docs for Targets and Layouts with remarks about default value. (@snakefoot) +- [#5922](https://github.com/NLog/NLog/pull/5922) XML docs for LayoutRenderers with remarks about default value. (@snakefoot) +- [#5925](https://github.com/NLog/NLog/pull/5925) XML docs for Target Wrappers with remarks about default value. (@snakefoot) +- [#5935](https://github.com/NLog/NLog/pull/5935) Improve NLog XSD Schema with better handling of typed Layout. (@snakefoot) +- [#5923](https://github.com/NLog/NLog/pull/5923) Updated unit-tests from NET6 to NET8. (@snakefoot) + +### Version 5.5.1 (2025/07/18) + +**Improvements** + +- [#5858](https://github.com/NLog/NLog/pull/5858) ConsoleTarget - Added ForceWriteLine to match NLog v6 Schema (#5858) (@snakefoot) +- [#5866](https://github.com/NLog/NLog/pull/5866) Layout.FromLiteral to match NLog v6 (#5866) (@snakefoot) +- [#5888](https://github.com/NLog/NLog/pull/5888) ChainsawTarget with type-alias Log4JXml to match NLog v6 (#5888) (@snakefoot) +- [#5883](https://github.com/NLog/NLog/pull/5883) AsyncTargetWrapper - LogEventDropped and EventQueueGrow events fixes (#5883) (@dance) +- [#5890](https://github.com/NLog/NLog/pull/5890) StringBuilderExt - Change Append2DigitsZeroPadded to array-lookup (#5890) (@snakefoot) +- [#5936](https://github.com/NLog/NLog/pull/5936) XmlLayout - Support MaxRecursionLimit == 0 (#5936) (@snakefoot) +- [#5936](https://github.com/NLog/NLog/pull/5936) RegisterObjectTransformation so build trimming will keep public properties (#5936) (@snakefoot) + +### Version 6.0.1 (2025/06/27) + +**Improvements** + +- [#5898](https://github.com/NLog/NLog/pull/5898) Changed ConditionExpression to be nullable by default since no Condition means no filtering. (@snakefoot) +- [#5906](https://github.com/NLog/NLog/pull/5906) Include ConditionExpression in the static type registration. (@snakefoot) +- [#5895](https://github.com/NLog/NLog/pull/5895) Fixed the new XML parser to handle XML comments just before end-tag. (@snakefoot) +- [#5905](https://github.com/NLog/NLog/pull/5905) Fixed the new XML parser to allow InnerText with greater-than characters. (@snakefoot) +- [#5891](https://github.com/NLog/NLog/pull/5891) Updated NLog.Targets.AtomicFile to support net8.0-windows without dependency on Mono.Posix.NETStandard. (@snakefoot) + +### Version 6.0 (2025/06/21) + +**Major Changes** + +- Support AOT builds without build warnings. +- New FileTarget without ConcurrentWrites support, but still support KeepFileOpen (true/false). +- Moved old FileTarget into the new nuget-package NLog.Targets.ConcurrentFile. +- Created new nuget-package NLog.Targets.AtomicFile that supports ConcurrentWrites for NET8 on both Windows / Linux. +- Created new nuget-package NLog.Targets.GZipFile that uses GZipStream for writing directly to compressed files. +- Moved MailTarget into the new nuget-package NLog.Targets.Mail. +- Moved NetworkTarget into the new nuget-package NLog.Targets.Network. +- New GelfTarget introduced for the new nuget-package NLog.Targets.Network. +- New SyslogTarget introduced for the new nuget-package NLog.Targets.Network. +- Moved TraceTarget and NLogTraceListener into the new nuget-package NLog.Targets.Trace. +- Moved WebServiceTarget into the new nuget-package NLog.Targets.WebService +- Renamed ChainsawTarget to Log4JXmlTarget to match Log4JXmlEventLayout +- Removed dependency on System.Text.RegularExpressions and introduced new nuget-package NLog.RegEx. +- Removed dependency on System.Xml.XmlReader by implementing own internal basic XML-Parser. +- Added support for params ReadOnlySpan when using C# 13 +- Skip LogEventInfo.Parameters-array-allocation when unable to defer message-template formatting. +- Updated NLog API with Nullable-support and introduced Layout.Empty +- Marked [RequiredParameter] as obsolete with Nullable-support, and instead validate options at initialization. + +NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html + +List of all [NLog 6.0 Pull Requests](https://github.com/NLog/NLog/pulls?q=is%3Apr+is%3Amerged+milestone:%226.0%22) +- [Breaking Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20change%22+is%3Amerged+milestone:%226.0%22) +- [Breaking Behavior Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20behavior%20change%22+is%3Amerged+milestone:%226.0%22) +- [Features](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Feature%22+is%3Amerged+milestone:%226.0%22) +- [Improvements](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Enhancement%22+is%3Amerged+milestone:%226.0%22) +- [Performance](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Performance%22+is%3Amerged+milestone:%226.0%22) + +### Version 6.0 RC4 (2025/06/15) + +**Improvements** +- Mark struct as readonly to allow compiler optimization +- RegisterObjectTransformation to preserve public properties +- Log4JXmlEventLayout - Enforce MaxRecursionLimit = 0 +- DatabaseTarget with support for AOT (@JohnVerheij) +- DatabaseTarget only assign ConnectionString when specified (@JohnVerheij) + +### Version 6.0 RC3 (2025/06/08) + +**Improvements** +- Log4JXmlEventLayout - Fixed IncludeEmptyValue for Parameters + +### Version 6.0 RC2 (2025/06/01) + +**Improvements** +- Fixed NLog XmlParser to support XML comments within XML processing instructions. +- NLog.Targets.Network now also supports NET35. +- Updated structs to be readonly to allow compiler optimizations. +- Updated interface ILoggingConfigurationElement to support nullable Values. +- Updated all projects to include `` +- Optimized ConsoleTarget to not use Console.WriteLine, and introduced option `ForceWriteLine` +- Added new LogEventInfo constructor that supports `ReadOnlySpan` +- Updated NLog.Schema nuget-package to include targets-file to copy NLog.xsd to project-folder. +- Improved configuration-file loading to advise about NLog nuget-packages for missing types. + +### Version 5.5 (2025/05/29) + +**Improvements** +- [#5710](https://github.com/NLog/NLog/pull/5710) Restored LogFactory.Setup().SetupFromEnvironmentVariables() as not obsolete (#5710) @snakefoot +- [#5717](https://github.com/NLog/NLog/pull/5717) Avoid using MakeGenericType for Dictionary enumeration when AOT (#5717) @snakefoot +- [#5730](https://github.com/NLog/NLog/pull/5730) Stop using obsolete Assembly.CodeBase for NetStandard (#5730) @snakefoot +- [#5742](https://github.com/NLog/NLog/pull/5742) ExceptionLayoutRenderer - Handle Exception properties like StackTrace can throw with AOT (#5742) @snakefoot +- [#5743](https://github.com/NLog/NLog/pull/5743) ExceptionLayoutRenderer - Handle Data-collection-item ToString can throw with AOT (#5743) @snakefoot +- [#5763](https://github.com/NLog/NLog/pull/5763) ExceptionLayoutRenderer - Handle Exception-properties can throw with AOT (#5763) @snakefoot +- [#5756](https://github.com/NLog/NLog/pull/5756) ServiceRepository - Improve exception-handling when resolving service-types while disposing (#5756) @snakefoot +- [#5759](https://github.com/NLog/NLog/pull/5759) LayoutRenderer - Optimize performance by skipping cache result from render Inner Layout (#5759) @snakefoot +- [#5795](https://github.com/NLog/NLog/pull/5795) ConditionLayoutExpression - Optimize performance by skipping cache result from render Inner Layout (#5795) @snakefoot +- [#5731](https://github.com/NLog/NLog/pull/5731) Mark IFactory RegisterType as obsolete, since it will be removed with NLog v6 (#5731) @snakefoot +- [#5766](https://github.com/NLog/NLog/pull/5766) Mark JsonLayout EscapeForwardSlash as obsolete, since disabled with NLog v6 (#5766) @snakefoot +- [#5823](https://github.com/NLog/NLog/pull/5823) Mark ExceptionLayoutRenderer Formats-List as obsolete, since immutable with NLog v6 (#5823) @snakefoot +- [#5769](https://github.com/NLog/NLog/pull/5769) Updated API-code examples to not depend on obsolete SimpleConfigurator (#5769) @snakefoot +- [#5776](https://github.com/NLog/NLog/pull/5776) ObjectReflectionCache - Handle PropertyValue can throw with AOT (#5776) @snakefoot +- [#5780](https://github.com/NLog/NLog/pull/5780) NetworkTarget - Introduced option NoDelay to disable delayed ACK (#5780) @snakefoot +- [#5788](https://github.com/NLog/NLog/pull/5788) Fix InternalLogger noise about reflection for FuncLayoutRenderer (#5788) @snakefoot +- [#5792](https://github.com/NLog/NLog/pull/5792) TargetWithContext - Reduce allocation for RenderLogEvent when SimpleLayout (#5792) @snakefoot +- [#5810](https://github.com/NLog/NLog/pull/5810) Refactoring to improve null value handling (#5810) @snakefoot +- [#5812](https://github.com/NLog/NLog/pull/5812) Refactoring to improve null value handling (#5812) @snakefoot +- [#5817](https://github.com/NLog/NLog/pull/5817) LoggingConfigurationParser - Prioritize LoggingRules from current config (#5817) @snakefoot +- [#5825](https://github.com/NLog/NLog/pull/5825) WhenEmptyLayoutRendererWrapper - Optimize IStringValueRenderer Logic (#5825) @snakefoot + +### Version 6.0 RC1 (2025/04/25) + +**Improvements** +- Updated NLog API with `enable` and introduced `Layout.Empty` +- Marked `[RequiredParameter]` as obsolete, and replaced with explicit option validation during initialization. +- Marked `LogEventInfo.SequenceID` and `${sequenceid}` as obsolete, and instead use `${counter:sequence=global}`. +- Added support for params ReadOnlySpan when using C# 13 +- Prioritize generic Logger-methods by marking legacy methods with `[OverloadResolutionPriority(-1)]` when using C# 13 +- Skip LogEventInfo.Parameters-array-allocation when unable to defer message-template formatting. +- Renamed ChainsawTarget to Log4JXmlTarget to match Log4JXmlEventLayout +- Updated NLog.Schema to include intellisense for multiple NLog-assemblies. + +### Version 6.0 Preview 1 (2025/04/27) + +NLog v6.0 release notes: https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html + +List of all [NLog 6.0 Pull Requests](https://github.com/NLog/NLog/pulls?q=is%3Apr+is%3Amerged+milestone:%226.0%22) +- [Breaking Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20change%22+is%3Amerged+milestone:%226.0%22) +- [Breaking Behavior Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20behavior%20change%22+is%3Amerged+milestone:%226.0%22) +- [Features](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Feature%22+is%3Amerged+milestone:%226.0%22) +- [Improvements](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Enhancement%22+is%3Amerged+milestone:%226.0%22) +- [Performance](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Performance%22+is%3Amerged+milestone:%226.0%22) + +### Version 5.3.4 (2024/09/12) + +**Improvements** +- [#5572](https://github.com/NLog/NLog/pull/5572) Layout.FromMethod that supports typed Layout (#5572) (@smnsht) +- [#5580](https://github.com/NLog/NLog/pull/5580) Layout.FromMethod that supports typed Layout (without boxing) (#5580) (@snakefoot) +- [#5570](https://github.com/NLog/NLog/pull/5570) ScopeContextPropertyEnumerator - Optimize HasUniqueCollectionKeys (#5570) (@snakefoot) +- [#5571](https://github.com/NLog/NLog/pull/5571) XmlLayout - Fixed bug in handling unsafe xml property names (#5571) (@snakefoot) +- [#5573](https://github.com/NLog/NLog/pull/5573) FuncThreadAgnosticLayoutRenderer - Implement IRawValue (#5573) (@snakefoot) +- [#5577](https://github.com/NLog/NLog/pull/5577) Introduced OnConfigurationAssigned to signal activation of LoggingConfiguration (#5577) (@snakefoot) +- [#5578](https://github.com/NLog/NLog/pull/5578) Update copyright to 2024, and removed trailing white spaces in source code (#5578) (@snakefoot) +- [#5585](https://github.com/NLog/NLog/pull/5585) Fixed various issues reported by EnableNETAnalyzers (#5585) (@snakefoot) +- [#5587](https://github.com/NLog/NLog/pull/5587) NetworkTarget - Added SendTimeoutSeconds to assign TCP Socket SendTimeout (#5587) (@snakefoot) +- [#5588](https://github.com/NLog/NLog/pull/5588) DateLayoutRenderer - Optimize for Round Trip ISO 8601 Date Format = o (#5588) (@snakefoot) +- [#5589](https://github.com/NLog/NLog/pull/5589) LayoutRenderer - Changed Render-method to use StringBuilderPool (#5589) (@snakefoot) +- [#5599](https://github.com/NLog/NLog/pull/5599) JsonLayout - Refactor code to simplify rendering of scope properties (#5599) (@snakefoot) +- [#5600](https://github.com/NLog/NLog/pull/5600) JsonLayout - Precalculate Json-Document delimiters upfront (#5600) (@snakefoot) + +### Version 5.3.3 (2024/08/12) + +**Improvements** +- [#5548](https://github.com/NLog/NLog/pull/5548) FileTarget - Reset reusable MemoryStream when above max capacity (#5548) (@RomanSoloweow) +- [#5568](https://github.com/NLog/NLog/pull/5568) ThreadIdLayoutRenderer - Added IStringValueRenderer optimization (#5568) (@snakefoot) +- [#5567](https://github.com/NLog/NLog/pull/5567) PropertiesDictionary - Simplify PropertyDictionaryEnumerator MoveNext (#5567) (@snakefoot) +- [#5566](https://github.com/NLog/NLog/pull/5566) PropertiesDictionary - Added PropertyDictionaryEnumerator to enumerate without allocation (#5566) (@snakefoot) +- [#5562](https://github.com/NLog/NLog/pull/5562) TargetWithContext - Skip caching when render value for ContextProperties (#5562) (@snakefoot) +- [#5557](https://github.com/NLog/NLog/pull/5557) SimpleLayout - Refactor to reduce code complexity (#5557) (@snakefoot) +- [#5556](https://github.com/NLog/NLog/pull/5556) DatabaseTarget - CloseConnection even when ThrowExceptions = true (#5556) (@snakefoot) +- [#5553](https://github.com/NLog/NLog/pull/5553) LoggerNameMatcher private classes marked as sealed (#5553) (@snakefoot) +- [#5554](https://github.com/NLog/NLog/pull/5554) LoggingConfigurationParser - Refactor to reduce code complexity (#5554) (@snakefoot) +- [#5551](https://github.com/NLog/NLog/pull/5551) LoggingConfigurationParser - Refactor to reduce code complexity (#5551) (@snakefoot) +- [#5550](https://github.com/NLog/NLog/pull/5550) FileArchiveModeRolling - Refactor to reduce code complexity (#5550) (@snakefoot) +- [#5542](https://github.com/NLog/NLog/pull/5542) LimitingTargetWrapper - Fix wiki-link in XML docs (#5542) (@snakefoot) +- [#5541](https://github.com/NLog/NLog/pull/5541) FileTarget - Improve internal logging when invalid FileName (#5541) (@snakefoot) +- [#5540](https://github.com/NLog/NLog/pull/5540) WhenRepeatedFilter - Added wiki-link in XML docs (#5540) (@snakefoot) +- [#5536](https://github.com/NLog/NLog/pull/5536) RegEx IsMatch is faster with RegexOptions.ExplicitCapture to skip capture (#5536) (@snakefoot) +- [#5535](https://github.com/NLog/NLog/pull/5535) PropertyTypeConverter - Use Type IsAssignableFrom instead of Equals (#5535) (@snakefoot) +- [#5527](https://github.com/NLog/NLog/pull/5527) StackTraceUsageUtils - Refactor to reduce code complexity (#5527) (@snakefoot) +- [#5526](https://github.com/NLog/NLog/pull/5526) AsyncRequestQueue - Premature optimization of Enqueue (#5526) (@snakefoot) +- [#5525](https://github.com/NLog/NLog/pull/5525) JsonLayout - Refactor to reduce code complexity (#5525) (@snakefoot) +- [#5524](https://github.com/NLog/NLog/pull/5524) XmlLayout - Refactor to reduce code complexity (#5524) (@snakefoot) +- [#5523](https://github.com/NLog/NLog/pull/5523) AsyncTaskTarget - Added more logging to diagnose batching logic (#5523) (@snakefoot) +- [#5522](https://github.com/NLog/NLog/pull/5522) Layout will always initializes nested layouts (#5522) (@snakefoot) +- [#5519](https://github.com/NLog/NLog/pull/5519) NLogTraceListener - Reduce boxing of EventType + EventId properties (#5519) (@snakefoot) + +### Version 5.3.2 (2024/04/30) + +**Bug fix** +- [#5515](https://github.com/NLog/NLog/pull/5515) Fix NullReferenceException when using LoggingRules with filters and no targets (#5515) (@snakefoot) + +### Version 5.3.1 (2024/04/27) + +**Improvements** +- [#5313](https://github.com/NLog/NLog/pull/5313) CallSite can hide single class type using AddCallSiteHiddenClassType (#5313) (@wadebaird) +- [#5489](https://github.com/NLog/NLog/pull/5489) Logging Rule with FinalMinLevel also supports dynamic filters (#5489) (@snakefoot) +- [#5463](https://github.com/NLog/NLog/pull/5463) LogManager GetCurrentClassLogger fallback to assembly-name when no namespace (#5463) (@snakefoot) +- [#5480](https://github.com/NLog/NLog/pull/5480) Logger LayoutRenderer able to output the Logger PrefixName (#5480) (@snakefoot) +- [#5466](https://github.com/NLog/NLog/pull/5466) NLogViewer Target - Allow override of the FormattedMessage (#5466) (@snakefoot) +- [#5487](https://github.com/NLog/NLog/pull/5487) CallSite fallback to Exception TargetSite when available (#5487) (@snakefoot) +- [#5242](https://github.com/NLog/NLog/pull/5242) NLogTraceListener - Align Filter-behavior for all Write-methods (#5242) (@snakefoot) +- [#5490](https://github.com/NLog/NLog/pull/5490) LogManager AddHiddenAssembly marked obsolete, instead use AddCallSiteHiddenAssembly (#5490) (@snakefoot) +- [#5443](https://github.com/NLog/NLog/pull/5443) InternalLogger - Marked LogToTrace as obsolete to reduce dependencies (#5443) (@snakefoot) +- [#5297](https://github.com/NLog/NLog/pull/5297) Replaced MutableUnsafeAttribute with ThreadAgnosticImmutableAttribute (#5297) (@snakefoot) +- [#5431](https://github.com/NLog/NLog/pull/5431) Marked ILoggerBase and ISuppress as obsolete and instead use ILogger (#5431) (@snakefoot) +- [#5491](https://github.com/NLog/NLog/pull/5491) LoggingRule - Marked ChildRules as obsolete (#5491) (@snakefoot) +- [#5416](https://github.com/NLog/NLog/pull/5416) FileTarget - Marked NetworkWrites as obsolete, and replaced by KeepFileOpen=false (#5416) (@snakefoot) +- [#5355](https://github.com/NLog/NLog/pull/5355) Marked EscapeDataNLogLegacy as obsolete (#5355) (@snakefoot) +- [#5380](https://github.com/NLog/NLog/pull/5380) WrapperTarget is the wrapper and not the wrapped (#5380) (@snakefoot) +- [#5485](https://github.com/NLog/NLog/pull/5485) LogFactory - Disconnect from Target write and Target flush (#5485) (@snakefoot) +- [#5509](https://github.com/NLog/NLog/pull/5509) NLog Schema nuget-package with updated license info (#5509) (@snakefoot) +- [#5493](https://github.com/NLog/NLog/pull/5493) Added sealed to internal classes (#5493) (@snakefoot) +- [#5497](https://github.com/NLog/NLog/pull/5497) Added more NLog Wiki Links to XML docs (#5497) (@snakefoot) +- [#5475](https://github.com/NLog/NLog/pull/5475) CsvLayout - Fixed links to NLog Wiki in XML docs (#5475) (@hangy) + +### Version 5.2.8 (2023/12/29) + +**Improvements** +- [#5450](https://github.com/NLog/NLog/pull/5450) ConfigurationItemFactory - Skip type attribute lookup for official types (#5450) (@snakefoot) +- [#5441](https://github.com/NLog/NLog/pull/5441) LoggingRule - ToString should recognize Final and FinalMinLevel (#5441) (@snakefoot) +- [#5438](https://github.com/NLog/NLog/pull/5438) FileTarget - Refactor Windows FileSystem Tunneling repair logic (#5438) (@snakefoot) +- [#5432](https://github.com/NLog/NLog/pull/5432) Hide obsolete methods and classes from intellisense (#5432) (@snakefoot) +- [#5429](https://github.com/NLog/NLog/pull/5429) CachedTimeSource - Added Thread.MemoryBarrier to avoid code-reordering (#5429) (@snakefoot) + +### Version 5.2.7 (2023/11/28) + +**Improvements** +- [#5427](https://github.com/NLog/NLog/pull/5427) FileTarget - Fix Windows FileSystem Tunneling when KeepFileOpen=false (#5427) (@snakefoot) +- [#5422](https://github.com/NLog/NLog/pull/5422) AppEnvironmentWrapper - Added Entry-Assembly as fallback for ProcessName (#5422) (@snakefoot) +- [#5419](https://github.com/NLog/NLog/pull/5419) Improved XML docs for MDC, MDLC, NDC, NDLC about being replaced by ScopeContext (#5419) (@snakefoot) + +### Version 5.2.6 (2023/11/19) + +**Improvements** +- [#5407](https://github.com/NLog/NLog/pull/5407) FileTarget - Added option WriteHeaderWhenInitialFileNotEmpty (#5407) (@RomanSoloweow) +- [#5381](https://github.com/NLog/NLog/pull/5381) FileTarget - Removed explicit File.Create to not trigger file-scanners (#5381) (@snakefoot) +- [#5382](https://github.com/NLog/NLog/pull/5382) FileTarget - SetCreationTimeUtc only when IsArchivingEnabled (#5382) (@snakefoot) +- [#5384](https://github.com/NLog/NLog/pull/5384) FileTarget - SetCreationTimeUtc always when running on Windows (#5384) (@snakefoot) +- [#5389](https://github.com/NLog/NLog/pull/5389) ColoredConsoleTarget - Added Setup-extension-method WriteToColoredConsole (#5389) (@snakefoot) +- [#5409](https://github.com/NLog/NLog/pull/5409) MemoryTarget - Make Logs-property thread-safe to enumerate (#5409) (@snakefoot) +- [#5413](https://github.com/NLog/NLog/pull/5413) MultiFileWatcher - Improve InternalLogger output to match on start and stop (#5413) (@snakefoot) +- [#5398](https://github.com/NLog/NLog/pull/5398) Marked obsolete members with EditorBrowsableState.Never (#5398) (@snakefoot) +- [#5412](https://github.com/NLog/NLog/pull/5412) Change TargetFrameworks to net461 when old VisualStudioVersion (#5412) (@snakefoot) + +### Version 5.2.5 (2023/10/15) + +**Improvements** +- [#5344](https://github.com/NLog/NLog/pull/5344) ConcurrentRequestQueue - Reduced SpinCount to 15, before monitor wait (#5344) (@snakefoot) +- [#5347](https://github.com/NLog/NLog/pull/5347) ConfigurationItemFactory - Improve exception message when unknown type-alias (#5347) (@snakefoot) +- [#5348](https://github.com/NLog/NLog/pull/5348) ConfigurationItemFactory - Faster scanning of relevant configuration item types (#5348) (@snakefoot) +- [#5349](https://github.com/NLog/NLog/pull/5349) FileTarget - Verify FilePathLayout not containing unexpected characters (#5349) (@snakefoot) +- [#5351](https://github.com/NLog/NLog/pull/5351) LogManager.ReconfigExistingLoggers with reduced memory allocation (#5351) (@snakefoot) +- [#5353](https://github.com/NLog/NLog/pull/5353) CsvLayout - Improve XML docs for CustomColumnDelimiter (#5353) (@snakefoot) +- [#5354](https://github.com/NLog/NLog/pull/5354) LogEventInfo - Can be immutable when having FormattedMessage and no parameters (#5354) (@snakefoot) +- [#5356](https://github.com/NLog/NLog/pull/5356) Renamed internal NLogXmlElement to XmlLoggingConfigurationElement and fixed XML docs (#5356) (@snakefoot) +- [#5359](https://github.com/NLog/NLog/pull/5359) StringHelpers - Skip SubString for case-insensitive Replace-method (#5359) (@snakefoot) +- [#5360](https://github.com/NLog/NLog/pull/5360) ReplaceLayoutRendererWrapper - IgnoreCase faster without RegEx (#5360) (@snakefoot) +- [#5363](https://github.com/NLog/NLog/pull/5363) Improved InternalLogger output when parsing NLog config with target wrappers (#5363) (@snakefoot) +- [#5370](https://github.com/NLog/NLog/pull/5370) NetworkTarget - Skip connection when above max message size (#5370) (@snakefoot) +- [#5371](https://github.com/NLog/NLog/pull/5371) Fixed various issues reported by EnableNETAnalyzers (#5371) (@snakefoot) +- [#5372](https://github.com/NLog/NLog/pull/5372) Updated various nuget-packages to include README.md (#5372) (@snakefoot) + +### Version 5.2.4 (2023/09/06) + +**Improvements** +- [#5316](https://github.com/NLog/NLog/pull/5316) ObjectPath should only render output when finding property-value (#5316) (@snakefoot) +- [#5318](https://github.com/NLog/NLog/pull/5318) Typed Layout parses empty string as fixed null value when nullable (#5318) (@snakefoot) +- [#5319](https://github.com/NLog/NLog/pull/5319) Introduced new LogEventInfo-constructor to skip Parameters-array allocation (#5319) (@snakefoot) +- [#5321](https://github.com/NLog/NLog/pull/5321) ConfigurationItemFactory - Improve obsolete message for JsonConverter + ValueFormatter (#5321) (@snakefoot) +- [#5326](https://github.com/NLog/NLog/pull/5326) InternalLogger - Force output even when invalid format string (#5326) (@snakefoot) +- [#5327](https://github.com/NLog/NLog/pull/5327) NetworkTarget - Avoid unhandled exception when using ThrowExceptions=true (#5327) (@snakefoot) +- [#5336](https://github.com/NLog/NLog/pull/5336) Skip checking ExcludeProperties when empty, to avoid string GetHashCode (#5336) (@snakefoot) +- [#5337](https://github.com/NLog/NLog/pull/5337) JsonLayout optimizing thread context capture for inner layouts (#5337) (@snakefoot) +- [#5310](https://github.com/NLog/NLog/pull/5310) FileTarget - FilePathLayout with fixed-filename can translate to absolute path (#5310) (@snakefoot) + +### Version 5.2.3 (2023/08/05) + +**Improvements** +- [#5308](https://github.com/NLog/NLog/pull/5308) AutoFlushTargetWrapper - Explicit flush should also await when FlushOnConditionOnly (#5308) (@snakefoot) +- [#5301](https://github.com/NLog/NLog/pull/5301) Target precalculate should only perform single IsInitialized check (#5301) (@snakefoot) +- [#5300](https://github.com/NLog/NLog/pull/5300) Target precalculate should only consider relevant layouts (#5300) (@snakefoot) +- [#5296](https://github.com/NLog/NLog/pull/5296) Target precalculate should handle duplicate layouts (#5296) (@snakefoot) +- [#5299](https://github.com/NLog/NLog/pull/5299) MessageLayoutRenderer - Skip Flatten when simple AggregateException (#5299) (@snakefoot) +- [#5298](https://github.com/NLog/NLog/pull/5298) ConfigurationItemFactory - Improve obsolete message for obsoleted factory-properties (#5298) (@snakefoot) +- [#5291](https://github.com/NLog/NLog/pull/5291) Report NLog version on initial configuration assignment (#5291) (@snakefoot) +- [#5290](https://github.com/NLog/NLog/pull/5290) PropertyHelper - SetPropertyFromString allow empty string for nullable-value (#5290) (@snakefoot) +- [#5289](https://github.com/NLog/NLog/pull/5289) Check RequiredParameter should also validate nullable types (#5289) (@snakefoot) +- [#5287](https://github.com/NLog/NLog/pull/5287) FileTarget - FilePathLayout with fixed-filename can translate to absolute path (#5287) (@snakefoot) +- [#5279](https://github.com/NLog/NLog/pull/5279) FileTarget - Cleanup FileSystemWatcher correctly when ArchiveFilePatternToWatch changes (#5279) (@lavige777) +- [#5281](https://github.com/NLog/NLog/pull/5281) Refactor ConditionBasedFilter when-filter to use ternary operator (#5281) (@jokoyoski) + +### Version 5.2.2 (2023/07/04) + +**Improvements** +- [#5276](https://github.com/NLog/NLog/pull/5276) ConfigurationItemFactory - Fix NullReferenceException when skipping already loaded assembly (#5276) (@snakefoot) + +### Version 5.2.1 (2023/07/01) + +**Improvements** +- [#5191](https://github.com/NLog/NLog/pull/5248) WrapperTarget - Derive Name from wrappedTarget (#5248) (@snakefoot) +- [#5249](https://github.com/NLog/NLog/pull/5249) Updated obsolete warning for ConfigurationReloaded-event (#5249) (@snakefoot) +- [#5251](https://github.com/NLog/NLog/pull/5251) ConfigurationItemFactory - Notify when using reflection to resolve type (#5251) (@snakefoot) +- [#5253](https://github.com/NLog/NLog/pull/5253) LoggingConfigurationParser - Create list items without using reflection (#5253) (@snakefoot) +- [#5254](https://github.com/NLog/NLog/pull/5254) ConfigurationItemFactory - Include ConditionExpression in registration (#5254) (@snakefoot) +- [#5255](https://github.com/NLog/NLog/pull/5255) LogFactory - Obsoleted GetLogger should not throw exceptions when invalid logger-type (#5255) (@snakefoot) +- [#5257](https://github.com/NLog/NLog/pull/5257) ConfigurationItemFactory - Skip assembly-loading should also check prefix-option (#5257) (@snakefoot) +- [#5263](https://github.com/NLog/NLog/pull/5263) ConfigurationItemFactory - Logging assembly-prefix when loading assembly (#5263) (@snakefoot) +- [#5266](https://github.com/NLog/NLog/pull/5266) ILogger - Remove irrelevant StructuredMessageTemplateAttribute (#5266) (@saltukkos) +- [#5267](https://github.com/NLog/NLog/pull/5267) ILogger - Updated obsolete warning for ErrorException-method and friends (#5267) (@snakefoot) +- [#5269](https://github.com/NLog/NLog/pull/5269) LoggingConfigurationParser - TryGetEnumValue should throw when invalid string-value (#5269) (@snakefoot) +- [#5268](https://github.com/NLog/NLog/pull/5268) ConfigurationItemFactory - Include ConditionMethods in registration (#5268) (@snakefoot) +- [#5273](https://github.com/NLog/NLog/pull/5273) TargetWithContext - Fix InternalLogger output about Object reflection needed (#5273) (@snakefoot) + +### Version 5.2 (2023/05/30) + +**Improvements** +- [#5191](https://github.com/NLog/NLog/pull/5191) ConfigurationItemFactory annotated for trimming and obsoleted CreateInstance-delegate (#5191) (@snakefoot) +- [#5216](https://github.com/NLog/NLog/pull/5216) Refactor - Apply ThrowIfNull and ThrowIfNullOrEmpty (#5216) (@nih0n) + +### Version 5.1.5 (2023/05/25) + +**Improvements** +- [#5229](https://github.com/NLog/NLog/pull/5229) TargetWithContext - Fixed ScopeContext capture when multiple wrappers (#5229) (@snakefoot) +- [#5227](https://github.com/NLog/NLog/pull/5227) DefaultJsonSerializer - Cache length when validating json encoding (#5227) (@snakefoot) +- [#5220](https://github.com/NLog/NLog/pull/5220) FileTarget - Suppress exceptions from retrieving FileInfo.CreationTimeUtc (#5220) (@snakefoot) +- [#5219](https://github.com/NLog/NLog/pull/5219) LoggingConfigurationParser - Handle adding Target without name (#5219) (@snakefoot) +- [#5215](https://github.com/NLog/NLog/pull/5215) Log4jXmlEvent - Fixed removal of invalid XML chars (#5215) (@snakefoot) +- [#5210](https://github.com/NLog/NLog/pull/5210) LoggingConfiguration - Expand NLog config variables for Logging Rules WriteTo (#5210) (@snakefoot) + +### Version 5.1.4 (2023/04/29) + +**Improvements** +- [#5207](https://github.com/NLog/NLog/pull/5207) FileTarget - Recover from file-deleted when same archive-folder (#5207) (@snakefoot) +- [#5201](https://github.com/NLog/NLog/pull/5201) NLog.xsd schema with support for variables section (#5201) (@michaelplavnik) +- [#5200](https://github.com/NLog/NLog/pull/5200) JsonLayout - Added IndentJson for pretty format (#5200) (@nih0n) +- [#5197](https://github.com/NLog/NLog/pull/5197) Log4jXmlEvent - Fix dummy-Namespace when using IncludeScopeProperties (#5197) (@snakefoot) +- [#5195](https://github.com/NLog/NLog/pull/5195) ConfigurationItemFactory - Handle concurrent registration with single lock (#5195) (@snakefoot) +- [#5193](https://github.com/NLog/NLog/pull/5193) AsyncTaskTarget - Include task exception on completed event (#5193) (@snakefoot) +- [#5186](https://github.com/NLog/NLog/pull/5186) ScopeContext - Uniform initial small array sizes (#5186) (@snakefoot) + +### Version 5.1.3 (2023/03/28) + +**Improvements** +- [#5174](https://github.com/NLog/NLog/pull/5174) LoggingRule - FinalMinLevel with Layout support (#5174) (@Aaronmsv) +- [#5177](https://github.com/NLog/NLog/pull/5177) MailTarget - Added support for email message headers (#5177) (@snakefoot) +- [#5175](https://github.com/NLog/NLog/pull/5175) ScopeContext - Replace rescursive lookup with enumeration (#5175) (@snakefoot) +- [#5168](https://github.com/NLog/NLog/pull/5168) MethodCallTarget - Compile Method Invoke as Expression Trees (#5168) (@snakefoot) +- [#5165](https://github.com/NLog/NLog/pull/5165) PaddingLayoutRendererWrapper - Avoid using Insert for reusable StringBuilder (#5165) (@snakefoot) +- [#5159](https://github.com/NLog/NLog/pull/5159) Json serializer with ISpanFormattable support for decimal + double (#5168) (@snakefoot) + +### Version 5.1.2 (2023/02/17) + +**Improvements** +- [#5157](https://github.com/NLog/NLog/pull/5157) FileTarget - Archive Dynamic FileName ordering ignore case (#5157) (@snakefoot) +- [#5150](https://github.com/NLog/NLog/pull/5150) EventLogTarget - EventId with LogEvent Property Lookup by default (#5150) (@snakefoot) +- [#5148](https://github.com/NLog/NLog/pull/5148) ReplaceLayoutRendererWrapper - SearchFor is required, and ReplaceWith optional (#5148) (@snakefoot) +- [#5146](https://github.com/NLog/NLog/pull/5146) SpecialFolderLayoutRenderer - Fallback for Windows Nano (#5146) (@snakefoot) +- [#5144](https://github.com/NLog/NLog/pull/5144) NetworkTarget emit LogEventDropped event on NetworkError (#5144) (@ShadowDancer) +- [#5141](https://github.com/NLog/NLog/pull/5141) AsyncTaskTarget - Dynamic wait time after TaskTimeoutSeconds has expired (#5141) (@snakefoot) +- [#5140](https://github.com/NLog/NLog/pull/5140) ConfigurationItemFactory - Handle concurrent registration with single lock (#5140) (@snakefoot) + +### Version 5.1.1 (2022/12/29) + +**Improvements** +- [#5134](https://github.com/NLog/NLog/pull/5134) XmlLayout - Added Layout-option to XmlElement to match XmlAttribute (#5134) (@snakefoot) +- [#5126](https://github.com/NLog/NLog/pull/5126) JsonLayout - Avoid NullReferenceException when JsonAttribute has no Layout (#5126) (@snakefoot) +- [#5122](https://github.com/NLog/NLog/pull/5122) ConfigurationItemFactory - Handle concurrent registration of extensions (#5122) (@snakefoot) +- [#5121](https://github.com/NLog/NLog/pull/5121) LogEventInfo with custom MessageFormatter now generates FormattedMessage upfront (#5121) (@snakefoot) +- [#5118](https://github.com/NLog/NLog/pull/5118) AsyncTargetWrapper - Reduce overhead when scheduling instant background writer thread (#5118) (@snakefoot) +- [#5115](https://github.com/NLog/NLog/pull/5115) ConfigurationItemFactory - Faster scan of NLog types with filter on IsPublic / IsClass (#5115) (@snakefoot) + +### Version 5.1.0 (2022/11/27) + +**Improvements** +- [#5102](https://github.com/NLog/NLog/pull/5102) MessageTemplates ValueFormatter with support for ISpanFormattable (#5102) (@snakefoot) +- [#5101](https://github.com/NLog/NLog/pull/5101) Add LogEventDropped handler to the NetworkTarget (#5101) (@ShadowDancer) +- [#5108](https://github.com/NLog/NLog/pull/5108) Improving InternalLogger output when adding NLog targets to configuration (#5108) (@snakefoot) +- [#5110](https://github.com/NLog/NLog/pull/5110) ObjectPathRendererWrapper - Added public method TryGetPropertyValue (#5110) (@snakefoot) + +### Version 5.0.5 (2022/10/26) + +**Improvements** +- [#5092](https://github.com/NLog/NLog/pull/5092) InternalLogger - LogFile expand filepath variables (#5092) (@RyanGaudion) +- [#5090](https://github.com/NLog/NLog/pull/5090) ReplaceNewLines - Support Replacement with newlines (#5090) (@Orace) +- [#5086](https://github.com/NLog/NLog/pull/5086) ScopeIndent LayoutRenderer (#5086) (@snakefoot) +- [#5085](https://github.com/NLog/NLog/pull/5085) Introduced TriLetter as LevelFormat (Trc, Dbg, Inf, Wrn, Err, Ftl) (#5085) (@snakefoot) +- [#5078](https://github.com/NLog/NLog/pull/5078) LogFactory.Setup - Added support for RegisterLayout and validate NLog types (#5078) (@snakefoot) +- [#5076](https://github.com/NLog/NLog/pull/5076) AutoFlushTargetWrapper - Fix race-condition that makes unit-tests unstable (#5076) (@snakefoot) +- [#5073](https://github.com/NLog/NLog/pull/5073) Include error-message from inner-exception when layout contains unknown layoutrenderer (#5073) (@snakefoot) +- [#5065](https://github.com/NLog/NLog/pull/5065) ObjectReflectionCache - Skip serializing System.Net.IPAddress (#5065) (@snakefoot) +- [#5060](https://github.com/NLog/NLog/pull/5060) ObjectReflectionCache - Skip reflection of delegate-objects (#5060) (@snakefoot) +- [#5057](https://github.com/NLog/NLog/pull/5057) OnException + OnHasProperties - Added Else-option (#5057) (@snakefoot) +- [#5056](https://github.com/NLog/NLog/pull/5056) LogEventBuilder - Added Log(Type wrapperType) for custom Logger wrapper (#5056) (@snakefoot) + +### Version 5.0.4 (2022/09/01) + +**Fixes** +- [#5051](https://github.com/NLog/NLog/pull/5051) Fixed embedded resource with ILLink.Descriptors.xml to avoid IL2007 (#5051) (@snakefoot) + +### Version 5.0.3 (2022/09/01) + +**Improvements** +- [#5034](https://github.com/NLog/NLog/pull/5034) Added embedded resource with ILLink.Descriptors.xml to skip AOT (#5034) (@snakefoot) +- [#5035](https://github.com/NLog/NLog/pull/5035) Layout Typed that can handle LogEventInfo is null (#5035) (@snakefoot) +- [#5036](https://github.com/NLog/NLog/pull/5036) JsonLayout - Fix output for Attributes with IncludeEmptyValue=false and Encode=false (#5036) (@snakefoot) + +### Version 5.0.2 (2022/08/12) + +**Improvements** +- [#5019](https://github.com/NLog/NLog/pull/5019) Layout Typed validates fixed values upfront at config initialization, instead of when logging (#5019) (@snakefoot) +- [#5026](https://github.com/NLog/NLog/pull/5026) Removed obsolete dependency Microsoft.Extensions.PlatformAbstractions (#5026) (@snakefoot) +- [#5016](https://github.com/NLog/NLog/pull/5016) WebServiceTarget - Verifies Url as RequiredParameter (#5016) (@snakefoot) +- [#5014](https://github.com/NLog/NLog/pull/5014) WebServiceTarget - Improve InternalLogging when Url is invalid (#5014) (@snakefoot) +- [#5010](https://github.com/NLog/NLog/pull/5010) GlobalDiagnosticsContext - Implicit caching of value lookup (#5010) (@snakefoot) +- [#5004](https://github.com/NLog/NLog/pull/5004) EventLogTarget - Bump default MaxMessageLength to 30000 to match limit in Win2008 (#5004) (@snakefoot) +- [#4995](https://github.com/NLog/NLog/pull/4995) Support UniversalTime = false when NLog time-source is UTC (#4995) (@snakefoot) +- [#4987](https://github.com/NLog/NLog/pull/4987) ConfigurationItemFactory - Include original type-alias when CreateInstance fails (#4987) (@snakefoot) +- [#4981](https://github.com/NLog/NLog/pull/4981) AssemblyVersionLayoutRenderer - Support override of Default value (#4981) (@snakefoot) +- [#4976](https://github.com/NLog/NLog/pull/4976) LoggingConfiguration - AddRule with overload for LoggingRule object (#4976) (@tvogel-nid) + +### Version 5.0.1 (2022/06/12) + +**Improvements** +- [#4938](https://github.com/NLog/NLog/pull/4938) LoggingConfigurationParser should alert when LoggingRule filters are bad (#4938) (@snakefoot) +- [#4940](https://github.com/NLog/NLog/pull/4940) CompoundLayout with layout from config variable (#4940) (@snakefoot) +- [#4944](https://github.com/NLog/NLog/pull/4944) Mark Target LayoutWithLock as obsolete, since only temporary workaround (#4944) (@snakefoot) +- [#4950](https://github.com/NLog/NLog/pull/4950) FileTarget - First acquire file-handle to compress before creating zip-file (#4950) (@snakefoot) +- [#4953](https://github.com/NLog/NLog/pull/4953) FileTarget - Zip compression should not truncate when zip-file already exists (#4953) (@snakefoot) +- [#4965](https://github.com/NLog/NLog/pull/4965) Max StackTraceUsage should be computed using bitwise OR (#4965) (@martinzding) +- [#4963](https://github.com/NLog/NLog/pull/4963) Improved source-code documentation by fixing spelling errors (#4963) (@KurnakovMaksim) + +### Version 5.0.0 (2022/05/16) + +See [List of major changes in NLog 5.0](https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html). + +**Improvements** +- [#4922](https://github.com/NLog/NLog/pull/4922) NetworkTarget - Dual Mode IPv4 mapped addresses over IPv6 (#4922) (@snakefoot) +- [#4895](https://github.com/NLog/NLog/pull/4895) LogManager.Setup().LoadConfigurationFromAssemblyResource() can load config from embedded resource (#4895) (@snakefoot) +- [#4893](https://github.com/NLog/NLog/pull/4893) NetworkTarget - Reduce memory allocations in UdpNetworkSender (#4893) (@snakefoot) +- [#4891](https://github.com/NLog/NLog/pull/4891) + [#4924](https://github.com/NLog/NLog/pull/4924) Log4JXmlEventLayoutRenderer - IncludeEventProperties default = true (#4891 + #4924) (@snakefoot) +- [#4887](https://github.com/NLog/NLog/pull/4887) NetworkTarget - Support Compress = GZip for UDP with GELF to GrayLog (#4887) (@snakefoot) +- [#4882](https://github.com/NLog/NLog/pull/4882) Updated dependencies for NetStandard1.x to fix warnings (#4882) (@snakefoot) +- [#4877](https://github.com/NLog/NLog/pull/4877) CounterLayoutRenderer - Support 64 bit integer and raw value (#4877) (@snakefoot) +- [#4867](https://github.com/NLog/NLog/pull/4867) WindowsIdentityLayoutRenderer - Dispose WindowsIdentity after use (#4867) (@snakefoot) +- [#4863](https://github.com/NLog/NLog/pull/4863) + [#4868](https://github.com/NLog/NLog/pull/4868) Support SpecialFolder UserApplicationDataDir for internalLogFile when parsing nlog.config (#4863 + #4868) (@snakefoot) +- [#4859](https://github.com/NLog/NLog/pull/4859) RetryingTargetWrapper - Changed RetryCount and RetryDelay to typed Layout (#4859) (@snakefoot) +- [#4858](https://github.com/NLog/NLog/pull/4858) BufferingTargetWrapper - Changed BufferSize + FlushTimeout to typed Layout (#4858) (@snakefoot) +- [#4857](https://github.com/NLog/NLog/pull/4857) LimitingTargetWrapper - Changed MessageLimit + Interval to typed Layout (#4857) (@snakefoot) +- [#4838](https://github.com/NLog/NLog/pull/4838) Added various null checks to improve code quality (#4838) (@KurnakovMaksim) +- [#4835](https://github.com/NLog/NLog/pull/4835) Fixed missing initialization of layout-parameters for ConditionMethodExpression (#4835) (@snakefoot) +- [#4824](https://github.com/NLog/NLog/pull/4824) LogFactory - Avoid checking candidate NLog-config files for every Logger created (#4824) (@snakefoot) +- [#4823](https://github.com/NLog/NLog/pull/4823) Improve InternalLogger output when testing candidate config file locations (#4823) (@snakefoot) +- [#4819](https://github.com/NLog/NLog/pull/4819) Improve loading of AppName.exe.nlog with .NET6 single file publish (#4819) (@snakefoot) +- [#4812](https://github.com/NLog/NLog/pull/4812) Translate ConditionParseException into NLogConfigurationException (#4812) (@snakefoot) +- [#4809](https://github.com/NLog/NLog/pull/4809) NLogConfigurationException - Improve styling of error-message when failing to assign property (#4809) (@snakefoot) +- [#4808](https://github.com/NLog/NLog/pull/4808) NLogRuntimeException constructor with string.Format marked obsolete (#4808) (@snakefoot) +- [#4807](https://github.com/NLog/NLog/pull/4807) NLogConfigurationException constructor with string.Format marked obsolete (#4807) (@snakefoot) +- [#4789](https://github.com/NLog/NLog/pull/4789) FallbackGroupTarget - Improve InternalLogger output when no more fallback (#4789) (@snakefoot) +- [#4788](https://github.com/NLog/NLog/pull/4788) NetworkTarget - Report to InternalLogger at Debug-level when discarding huge LogEvents (#4788) (@snakefoot) +- [#4787](https://github.com/NLog/NLog/pull/4787) Added extra JetBrains Annotations with StructuredMessageTemplateAttribute (#4787) (@snakefoot) +- [#4785](https://github.com/NLog/NLog/pull/4785) Improve InternalLogger output for unnamed nested wrapper targets (#4785) (@snakefoot) +- [#4784](https://github.com/NLog/NLog/pull/4784) Improve InternalLogger output for named nested wrapper targets (#4784) (@snakefoot) +- [#4777](https://github.com/NLog/NLog/pull/4777) DatabaseTarget - Removed alias DB to avoid promoting acronyms (#4777) (@snakefoot) +- [#4776](https://github.com/NLog/NLog/pull/4776) LoggingRule - Allow FinalMinLevel to override previous rules (#4776) (@snakefoot) +- [#4775](https://github.com/NLog/NLog/pull/4775) InternalLogger IncludeTimestamp = true by default to restore original behavior (#4775) (@snakefoot) +- [#4773](https://github.com/NLog/NLog/pull/4773) Fix xml-docs and replaced broken link config.html with wiki-link (#4773) (@snakefoot) +- [#4772](https://github.com/NLog/NLog/pull/4772) Improve InternalLogger output when queue OnOverflow (#4772) (@snakefoot) +- [#4770](https://github.com/NLog/NLog/pull/4770) LogFactory DefaultCultureInfo-setter should also update active config (#4770) (@snakefoot) + +### Version 5.0-RC2 (2022/01/19) + +**Features** +- [#4761](https://github.com/NLog/NLog/pull/4761) LogFactory fluent Setup with AddCallSiteHiddenAssembly (#4761) (@snakefoot) +- [#4757](https://github.com/NLog/NLog/pull/4757) Updated JetBrains Annotations with StructuredMessageTemplateAttribute (#4757) (@snakefoot) +- [#4754](https://github.com/NLog/NLog/pull/4754) JsonArrayLayout - Render LogEvent in Json-Array format (#4754) (@snakefoot) +- [#4613](https://github.com/NLog/NLog/pull/4613) Added LogFactory.ReconfigureExistingLoggers with purgeObsoleteLoggers option (#4613) (@sjafarianm) +- [#4711](https://github.com/NLog/NLog/pull/4711) Added WithProperties-method for Logger-class (#4711) (@simoneserra93) + +**Improvements** +- [#4730](https://github.com/NLog/NLog/pull/4730) MemoryTarget - Updated to implement TargetWithLayoutHeaderAndFooter (#4730) (@snakefoot) +- [#4730](https://github.com/NLog/NLog/pull/4730) TraceTarget - Updated to implement TargetWithLayoutHeaderAndFooter (#4730) (@snakefoot) +- [#4717](https://github.com/NLog/NLog/pull/4717) DatabaseTarget - Improved parsing of DbType (#4717) (@Orace) + +### Version 5.0-RC1 (2021/12/20) + +**Features** +- [#4662](https://github.com/NLog/NLog/pull/4662) LogFactory Setup fluent with SetupLogFactory for general options (#4662) (@snakefoot) +- [#4648](https://github.com/NLog/NLog/pull/4648) LogFactory fluent Setup with FilterDynamicIgnore + FilterDynamicLog (#4648) (@snakefoot) +- [#4642](https://github.com/NLog/NLog/pull/4642) TargetWithContext - Added support for ExcludeProperties (#4642) (@snakefoot) + +**Improvements** +- [#4656](https://github.com/NLog/NLog/pull/4656) FallbackGroupTarget - Added support for EnableBatchWrite (#4656) (@snakefoot) +- [#4655](https://github.com/NLog/NLog/pull/4655) JsonLayout - ExcludeProperties should also handle IncludeScopeProperties (#4655) (@snakefoot) +- [#4645](https://github.com/NLog/NLog/pull/4645) TargetWithContext - IncludeEmptyValue false by default (#4645) (@snakefoot) +- [#4646](https://github.com/NLog/NLog/pull/4646) PropertiesDictionary - Generate unique message-template-names on duplicate keys (#4646) (@snakefoot) +- [#4661](https://github.com/NLog/NLog/pull/4661) LoggingRule - Fix XML documentation (#4661) (@GitHubPang) +- [#4671](https://github.com/NLog/NLog/pull/4671) Fixed RegisterObjectTransformation to handle conversion to simple values (#4671) (@snakefoot) +- [#4669](https://github.com/NLog/NLog/pull/4669) LogLevel - Replaced IConvertible with IFormattable for better Json output (#4669) (@snakefoot) +- [#4676](https://github.com/NLog/NLog/pull/4676) NLog.Wcf - Updated nuget dependencies to System.ServiceModel ver. 4.4.4 (#4676) (@snakefoot) +- [#4675](https://github.com/NLog/NLog/pull/4675) FileTarget - Improve fallback logic when running on Linux without File BirthTIme (#4675) (@snakefoot) +- [#4680](https://github.com/NLog/NLog/pull/4680) FileTarget - Better handling of relative paths with FileSystemWatcher (#4680) (@snakefoot) +- [#4689](https://github.com/NLog/NLog/pull/4689) Renamed AppSettingLayoutRenderer2 to AppSettingLayoutRenderer after removing NLog.Extended (#4689) (@snakefoot) +- [#4563](https://github.com/NLog/NLog/pull/4563) Added alias ToUpper and ToLower as alternative to UpperCase and LowerCase (#4563) (@snakefoot) +- [#4695](https://github.com/NLog/NLog/pull/4695) Ignore dash (-) when parsing layouts, layoutrenderers and targets (#4695) (@304NotModified) +- [#4713](https://github.com/NLog/NLog/pull/4713) Logger SetProperty marked as obsolete, instead use WithProperty or the unsafe Properties-property (#4713) (@snakefoot) +- [#4714](https://github.com/NLog/NLog/pull/4714) Hide obsolete methods from intellisense (#4714) (@snakefoot) + +**Performance** +- [#4672](https://github.com/NLog/NLog/pull/4672) PaddingLayoutRendererWrapper - Pad operation with reduced string allocation (#4672) (@snakefoot) +- [#4698](https://github.com/NLog/NLog/pull/4698) FileTarget - Use Environment.TickCount to trigger File.Exists checks (#4698) (@snakefoot) +- [#4699](https://github.com/NLog/NLog/pull/4699) AsyncTargetWrapper - Fix performance for OverflowAction Block on NetCore (#4699) (@snakefoot) +- [#4705](https://github.com/NLog/NLog/pull/4705) LogEventInfo - Faster clone of messageTemplateParameters by caching Count (#4705) (@snakefoot) + +### Version 5.0-Preview 3 (2021/10/26) + +**Fixes** +- [#4627](https://github.com/NLog/NLog/pull/4627) PropertiesDictionary - Fixed threading issue in EventProperties (#4627) (@snakefoot) + +**Features** +- [#4598](https://github.com/NLog/NLog/pull/4598) LogFactory fluent Setup with WriteToTrace + WriteToDebug (#4598) (@snakefoot) +- [#4628](https://github.com/NLog/NLog/pull/4628) LogEventInfo constructor with eventProperties as IReadOnlyList (#4628) (@snakefoot) +- [#4633](https://github.com/NLog/NLog/pull/4633) ${event-properties} now ignore case when doing property lookup (#4633) (@snakefoot) + +**Improvements** +- [#4623](https://github.com/NLog/NLog/pull/4623) FileTarget - KeepFileOpen = true by default to avoid loosing file handle (#4623) (@snakefoot) +- [#4624](https://github.com/NLog/NLog/pull/4624) FileTarget - Only enable FileSystemWatcher when ConcurrentWrites = true (#4624) (@snakefoot) +- [#4634](https://github.com/NLog/NLog/pull/4634) FileTarget - Attempt to write footer, before closing file appender (#4634) (@snakefoot) +- [#4632](https://github.com/NLog/NLog/pull/4632) JsonSerializeOptions - Marked Format + FormatProvider + QuoteKeys as obsolete (#4632) (@snakefoot) +- [#4622](https://github.com/NLog/NLog/pull/4622) Handle OutOfMemoryException instead of crashing the application (#4622) (@snakefoot) +- [#4605](https://github.com/NLog/NLog/pull/4605) Removed DefaultValue-attribute as it is only used for docs-generator (#4605) (@snakefoot) +- [#4606](https://github.com/NLog/NLog/pull/4606) Removed Advanced-attribute as it has no meaning (#4606) (@snakefoot) + +### Version 5.0-Preview 2 (2021/10/02) + +**Fixes** +- [#4533](https://github.com/NLog/NLog/pull/4533) Fixed validation of nlog-element when using include-files (#4533) (@snakefoot) +- [#4555](https://github.com/NLog/NLog/pull/4555) Fixed validation of nlog-element when nested within configuration-element (#4555) (@snakefoot) + +**Features** +- [#4542](https://github.com/NLog/NLog/pull/4542) NetworkTarget - Added OnQueueOverflow with default Discard (#4542) (@snakefoot) + +**Improvements** +- [#4544](https://github.com/NLog/NLog/pull/4544) ScopeContext - Renamed IncludeScopeNestedStates to IncludeScopeNested for consistency (#4544) (@snakefoot) +- [#4545](https://github.com/NLog/NLog/pull/4545) ScopeContext - Renamed PushScopeState to PushScopeNested for consistency (#4545) (@snakefoot) +- [#4556](https://github.com/NLog/NLog/pull/4556) NetworkTarget - Explicit assigning LineEnding activates NewLine automatically (#4556) (@snakefoot) +- [#4549](https://github.com/NLog/NLog/pull/4549) NetworkTarget - UdpNetworkSender changed to QueuedNetworkSender with correct message split (#4549) (@snakefoot) +- [#4542](https://github.com/NLog/NLog/pull/4542) NetworkTarget - Changed OnConnectionOverflow to discard by default (#4542) (@snakefoot) +- [#4564](https://github.com/NLog/NLog/pull/4564) Fixed LayoutParser so Typed Layout works for LayoutRenderer (#4564) (@snakefoot) +- [#4580](https://github.com/NLog/NLog/pull/4580) LayoutRenderer and Layout are now always threadsafe by default (#4580) (@snakefoot) +- [#4586](https://github.com/NLog/NLog/pull/4586) ScopeTiming - No Format specified renders TimeSpan.TotalMilliseconds (#4586) (@snakefoot) +- [#4583](https://github.com/NLog/NLog/pull/4583) ExceptionLayoutRenderer - Separator with basic layout support (#4583) (@snakefoot) +- [#4588](https://github.com/NLog/NLog/pull/4588) StackTraceLayoutRenderer - Separator with basic layout support (#4588) (@snakefoot) +- [#4589](https://github.com/NLog/NLog/pull/4589) ScopeNestedLayoutRenderer - Separator with basic layout support (#4589) (@snakefoot) + +### Version 5.0-Preview 1 (2021/08/25) -#### Features +See NLog 5 release post: https://nlog-project.org/2021/08/25/nlog-5-0-preview1-ready.html + +- [Breaking Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20change%22+is%3Amerged+milestone:%225.0%22) + +- [Breaking Behavior Changes](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22breaking%20behavior%20change%22+is%3Amerged+milestone:%225.0%22) + +- [Features](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Feature%22+is%3Amerged+milestone:%225.0%22) + +- [Improvements](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Enhancement%22+is%3Amerged+milestone:%225.0%22) + +- [Performance](https://github.com/NLog/NLog/pulls?q=is%3Apr+label%3A%22Performance%22+is%3Amerged+milestone:%225.0%22) + +### Version 4.7.15 (2022/03/26) + +**Improvements** +- [#4836](https://github.com/NLog/NLog/pull/4836) Fixed missing initialization of layout-parameters for ConditionMethodExpression (#4836) (@snakefoot) +- [#4821](https://github.com/NLog/NLog/pull/4821) LogEventInfo - Optimize copy messageTemplateParameters by caching Count (#4821) (@snakefoot) +- [#4820](https://github.com/NLog/NLog/pull/4820) Improve loading of AppName.exe.nlog with .NET6 single file publish (#4820) (@snakefoot) +- [#4806](https://github.com/NLog/NLog/pull/4806) NLogConfigurationException - Skip string.Format when no args (#4806) (@snakefoot) + +### Version 4.7.14 (2022/02/22) + +**Improvements** +- [#4799](https://github.com/NLog/NLog/pull/4799) Added IncludeEventProperties + IncludeScopeProperties to improve transition (#4799) (@snakefoot) +- [#4786](https://github.com/NLog/NLog/pull/4786) Refactored code to remove false positives from code analysis (#4786) (@snakefoot) + +### Version 4.7.13 (2021/12/05) + +**Fixes** +- [#4700](https://github.com/NLog/NLog/pull/4700) AsyncTargetWrapper - Fix performance for OverflowAction Block on NetCore (#4700) (@snakefoot) +- [#4644](https://github.com/NLog/NLog/pull/4644) AsyncTargetWrapper - Swallow OutOfMemoryException instead of crashing (#4644) (@snakefoot) + +**Improvements** +- [#4649](https://github.com/NLog/NLog/pull/4649) Fix broken XML doc comment (#4649) (@GitHubPang) + +### Version 4.7.12 (2021/10/24) + +**Fixes** +- [#4627](https://github.com/NLog/NLog/pull/4627) PropertiesDictionary - Fixed threading issue in EventProperties (#4627) (@snakefoot) +- [#4631](https://github.com/NLog/NLog/pull/4631) FileTarget - Failing to CleanupInitializedFiles should not stop logging (#4631) (@snakefoot) + +**Features** +- [#4629](https://github.com/NLog/NLog/pull/4629) LogEventInfo constructor with eventProperties as IReadOnlyList (#4629) (@snakefoot) + +### Version 4.7.11 (2021/08/18) + +**Fixes** +- [#4519](https://github.com/NLog/NLog/pull/4519) JsonSerializer - Fix CultureNotFoundException with Globalization Invariant Mode (#4519) (@snakefoot) + +**Features** +- [#4475](https://github.com/NLog/NLog/pull/4475) WebServiceTarget - Added support for assigning UserAgent-Header (#4475) (@snakefoot) + +### Version 4.7.10 (2021/05/14) + +**Fixes** +- [#4401](https://github.com/NLog/NLog/pull/4401) JsonSerializer - Fixed bug when handling custom IConvertible returning TypeCode.Empty (#4401) (@snakefoot) + +**Improvements** +- [#4391](https://github.com/NLog/NLog/pull/4391) Support TargetDefaultParameters and TargetDefaultWrapper (#4391) (@snakefoot) +- [#4403](https://github.com/NLog/NLog/pull/4403) JsonLayout - Apply EscapeForwardSlash for LogEventInfo.Properties (#4403) (@snakefoot) +- [#4393](https://github.com/NLog/NLog/pull/4393) NLog.Config package: Updated hyperlink (#4393) (@snakefoot) + +### Version 4.7.9 (2021/03/24) + +**Fixes** +- [#4349](https://github.com/NLog/NLog/pull/4349) Fixed TrimDirectorySeparators to not use the root-path on Linux (#4349) (@snakefoot) +- [#4353](https://github.com/NLog/NLog/pull/4353) Fixed FileTarget archive cleanup within same folder at startup (#4353) (@snakefoot) +- [#4352](https://github.com/NLog/NLog/pull/4352) Fixed FileTarget archive cleanup when using short filename (#4352) (@snakefoot) + +**Improvements** +- [#4326](https://github.com/NLog/NLog/pull/4326) Make it possible to extend the FuncLayoutRenderer (#4326) (@304NotModified) +- [#4369](https://github.com/NLog/NLog/pull/4369) + [#4375](https://github.com/NLog/NLog/pull/4375) LoggingConfigurationParser - Recognize LoggingRule.FilterDefaultAction (#4369 + #4375) (@snakefoot) + +**Performance** +- [#4337](https://github.com/NLog/NLog/pull/4337) JsonLayout - Avoid constant string-escape of JsonAttribute Name-property (#4337) (@snakefoot) + +### Version 4.7.8 (2021/02/25) + +**Fixes** +- [#4316](https://github.com/NLog/NLog/pull/4316) Fix TrimDirectorySeparators to handle root-path on Windows and Linux to load Nlog.config from root-path (#4316) (@snakefoot) + +**Improvements** +- [#4273](https://github.com/NLog/NLog/pull/4273) Handle Breaking change with string.IndexOf(string) in .NET 5 (#4273) (@snakefoot) +- [#4301](https://github.com/NLog/NLog/pull/4301) Update docs, remove ArrayList in docs (#4301) (@304NotModified) + +### Version 4.7.7 (2021/01/20) + +**Fixes** +- [#4229](https://github.com/NLog/NLog/pull/4229) Skip lookup MainModule.FileName on Android platform to avoid crash (#4229) (@snakefoot) +- [#4202](https://github.com/NLog/NLog/pull/4202) JsonLayout - Generate correct json for keys that contain quote (#4202) (@virgilp) +- [#4245](https://github.com/NLog/NLog/pull/4245) JsonLayout - Unwind after invalid property value to avoid invalid Json (#4245) (@snakefoot) + +**Improvements** +- [#4222](https://github.com/NLog/NLog/pull/4222) Better handling of low memory (#4222) (@snakefoot) +- [#4221](https://github.com/NLog/NLog/pull/4221) JsonLayout - Added new ExcludeEmptyProperties to skip GDC/MDC/MLDC properties with null or empty values (#4221) (@pruiz) + +**Performance** +- [#4207](https://github.com/NLog/NLog/pull/4207) Skip allocation of SingleCallContinuation when ThrowExceptions = false (#4207) (@snakefoot) + +### Version 4.7.6 (2020/12/06) + +**Fixes** +- [#4142](https://github.com/NLog/NLog/pull/4142) JsonSerializer - Ensure invariant formatting of DateTimeOffset (#4142) (@snakefoot) +- [#4172](https://github.com/NLog/NLog/pull/4172) AsyncTaskTarget - Flush when buffer is full should not block forever (#4172) (@snakefoot) +- [#4182](https://github.com/NLog/NLog/pull/4182) Failing to lookup ProcessName because of Access Denied should fallback to Win32-API (#4182) (@snakefoot) + +**Features** +- [#4153](https://github.com/NLog/NLog/pull/4153) ExceptionLayoutRenderer - Added FlattenException option (#4153) (@snakefoot) + +**Improvements** +- [#4141](https://github.com/NLog/NLog/pull/4141) NetworkTarget - Improve handling of synchronous exceptions from UdpClient.SendAsync (#4141) (@snakefoot) +- [#4176](https://github.com/NLog/NLog/pull/4176) AsyncTaskTarget - Include TaskScheduler in ContinueWith (#4176) (@snakefoot) +- [#4190](https://github.com/NLog/NLog/pull/4190) Improving debugger-display for Logger.Properties and LogEventInfo.Properties (@snakefoot) + +**Performance** +- [#4132](https://github.com/NLog/NLog/pull/4132) Improve thread concurrency when using wrapper cached=true (#4132) (@snakefoot) +- [#4171](https://github.com/NLog/NLog/pull/4171) ConditionLayoutExpression - Skip allocating StringBuilder for every condition check (#4171) (@snakefoot) + +### Version 4.7.5 (2020/09/27) + +**Fixes** +- [#4106](https://github.com/NLog/NLog/pull/4106) FileTarget - New current file should write start header, when archive operation is performed on previous file (#4106) (@snakefoot) + +**Improvements** +- [#4102](https://github.com/NLog/NLog/pull/4102) LoggingConfiguration - ValidateConfig should only throw when enabled (#4102) (@snakefoot) +- [#4114](https://github.com/NLog/NLog/pull/4114) Fix VerificationException Operation could destabilize the runtime (#4114) (@snakefoot) + +**Performance** +- [#4115](https://github.com/NLog/NLog/pull/4115) Removed EmptyDefaultDictionary from MappedDiagnosticsContext (#4115) (@snakefoot) + +**Other** +- [#4109](https://github.com/NLog/NLog/pull/4109) Fix root .editorconfig to use end_of_line = CRLF. Remove local .editorconfig (#4109) (@snakefoot) +- [#4097](https://github.com/NLog/NLog/pull/4097) Improve docs (#4097) (@304NotModified) + +### Version 4.7.4 (2020/08/22) + +**Features** +- [#4076](https://github.com/NLog/NLog/pull/4076) DatabaseTarget - Added AllowDbNull for easier support for nullable parameters (#4076) (@snakefoot) + +**Fixes** +- [#4069](https://github.com/NLog/NLog/pull/4069) Fluent LogBuilder should suppress exception on invalid callerFilePath (#4069) (@snakefoot) + +**Improvements** +- [#4073](https://github.com/NLog/NLog/pull/4073) FileTarget - Extra validation of the LogEvent-timestamp before checking time to archive (#4073) (@snakefoot) +- [#4068](https://github.com/NLog/NLog/pull/4068) FileTarget - Improve diagnostic logging to see reason for archiving (@snakefoot) + +### Version 4.7.3 (2020/07/31) + +**Features** +- [#4017](https://github.com/NLog/NLog/pull/4017) Allow to change the RuleName of a LoggingRule (#4017) (@304NotModified) +- [#3974](https://github.com/NLog/NLog/pull/3974) logging of AggregrateException.Data to prevent it from losing it after Flatten call (#3974) (@chaos0307) + +**Fixes** +- [#4011](https://github.com/NLog/NLog/pull/4011) LocalIpAddressLayoutRenderer - IsDnsEligible and PrefixOrigin throws PlatformNotSupportedException on Linux (#4011) (@snakefoot) + +**Improvements** +- [#4057](https://github.com/NLog/NLog/pull/4057) ObjectReflectionCache - Reduce noise from properties that throws exceptions like Stream.ReadTimeout (#4057) (@snakefoot) +- [#4053](https://github.com/NLog/NLog/pull/4053) MessageTemplates - Changed Literal.Skip to be Int32 to support message templates longer than short.MaxValue (#4053) (@snakefoot) +- [#4043](https://github.com/NLog/NLog/pull/4043) ObjectReflectionCache - Skip reflection for Stream objects (#4043) (@snakefoot) +- [#3999](https://github.com/NLog/NLog/pull/3999) LogFactory Shutdown is public so it can be used from NLogLoggerProvider (#3999) (@snakefoot) +- [#3972](https://github.com/NLog/NLog/pull/3972) Editor config with File header template (#3972) (@304NotModified) + +**Performance** +- [#4058](https://github.com/NLog/NLog/pull/4058) FileTarget - Skip delegate capture in GetFileCreationTimeSource. Fallback only necessary when appender has been closed. (#4058) (@snakefoot) +- [#4021](https://github.com/NLog/NLog/pull/4021) ObjectReflectionCache - Reduce initial memory allocation until needed (#4021) (@snakefoot) +- [#3977](https://github.com/NLog/NLog/pull/3977) FilteringTargetWrapper - Remove delegate allocation (#3977) (@snakefoot) + +### Version 4.7.2 (2020/05/18) + +**Fixes** +- [#3969](https://github.com/NLog/NLog/pull/3969) FileTarget - ArchiveOldFileOnStartup not working together with ArchiveAboveSize (@snakefoot) + +**Improvements** +- [#3962](https://github.com/NLog/NLog/pull/3962) XSD: Added Enabled attribute for (@304NotModified) + +### Version 4.7.1 (2020/05/15) + +**Features** +- [#3871](https://github.com/NLog/NLog/pull/3871) LogManager.Setup().LoadConfigurationFromFile("NLog.config") added to fluent setup (@snakefoot + @304NotModified) +- [#3909](https://github.com/NLog/NLog/pull/3909) LogManager.Setup().GetCurrentClassLogger() added to fluent setup (@snakefoot + @304NotModified) +- [#3861](https://github.com/NLog/NLog/pull/3861) LogManager.Setup().SetupInternalLogger(s => s.AddLogSubscription()) added to fluent setup (@snakefoot + @304NotModified) +- [#3891](https://github.com/NLog/NLog/pull/3891) ColoredConsoleTarget - Added Condition option to control when to do word-highlight (@snakefoot) +- [#3915](https://github.com/NLog/NLog/pull/3915) Added new option CaptureStackTrace to ${stacktrace} and ${callsite} to skip implicit capture by Logger (@snakefoot) +- [#3940](https://github.com/NLog/NLog/pull/3940) Exception-LayoutRenderer with new option BaseException for rendering innermost exception (@snakefoot) + +**Improvements** +- [#3857](https://github.com/NLog/NLog/pull/3857) FileTarget - Batch write to filestream in max chunksize of 100 times BufferSize (@snakefoot) +- [#3867](https://github.com/NLog/NLog/pull/3867) InternalLogger include whether NLog comes from GlobalAssemblyCache when logging NLog version (@snakefoot) +- [#3862](https://github.com/NLog/NLog/pull/3862) InternalLogger LogToFile now support ${processdir} to improve support for single-file-publish (@snakefoot) +- [#3877](https://github.com/NLog/NLog/pull/3877) Added ${processdir} that matches ${basedir:processDir=true} for consistency with InternalLogger (@snakefoot) +- [#3881](https://github.com/NLog/NLog/pull/3881) Object property reflection now support IReadOnlyDictionary as expando object (@snakefoot) +- [#3884](https://github.com/NLog/NLog/pull/3884) InternalLogger include more details like FilePath when loading NLog.config file (@snakefoot) +- [#3895](https://github.com/NLog/NLog/pull/3895) Added support for Nullable when doing conversion of property types (@304NotModified) +- [#3896](https://github.com/NLog/NLog/pull/3896) InternalLogger Warnings when skipping unrecognized LayoutRenderer options (@snakefoot) +- [#3901](https://github.com/NLog/NLog/pull/3901) MappedDiagnosticsLogicalContext - SetScoped with IReadOnlyList also for Xamarin (@snakefoot) +- [#3904](https://github.com/NLog/NLog/pull/3904) Object property reflection automatically performs ToString for System.Reflection.Module (@snakefoot) +- [#3921](https://github.com/NLog/NLog/pull/3921) Improve ${basedir:fixtempdir=true} to work better on Linux when TMPDIR not set (@snakefoot) +- [#3928](https://github.com/NLog/NLog/pull/3928) NetworkTarget respect MaxQueueSize for http- / https-protocol (@snakefoot) +- [#3930](https://github.com/NLog/NLog/pull/3930) LogFactory.LoadConfiguration() reports searched paths when throwing FileNotFoundException (@304NotModified) +- [#3949](https://github.com/NLog/NLog/pull/3949) ReplaceNewLines-LayoutRenderer will also remove windows newlines on the Linux platform (@Silvenga) + +**Fixes** +- [#3868](https://github.com/NLog/NLog/pull/3868) SplitGroup Target Wrapper should not skip remaining targets when single target fails (@snakefoot) +- [#3918](https://github.com/NLog/NLog/pull/3918) ColoredConsoleTarget - Fix bug in handling of newlines without word-highlight (@snakefoot) +- [#3941](https://github.com/NLog/NLog/pull/3941) ${processid} will no longer fail because unable to lookup ${processdir} on Mono Android (@snakefoot) + +**Performance** +- [#3855](https://github.com/NLog/NLog/pull/3855) FileTarget - Skip checking file-length when only using ArchiveEvery (@snakefoot) +- [#3898](https://github.com/NLog/NLog/pull/3898) ObjectGraphScanner performs caching of property reflection for NLog config items (@snakefoot) +- [#3894](https://github.com/NLog/NLog/pull/3894) Condition expressions now handles operator like '==' without memory boxing (@snakefoot) +- [#3903](https://github.com/NLog/NLog/pull/3903) ObjectGraphScanner should only check for layout-attributes on Layouts and LayoutRenderers (@snakefoot) +- [#3902](https://github.com/NLog/NLog/pull/3902) MessageTemplate parsing of properties skips unnecessary array allocation (@snakefoot) + + +### Version 4.7 (2020/03/20) + +**Features** - [#3686](https://github.com/NLog/NLog/pull/3686) + [#3740](https://github.com/NLog/NLog/pull/3740) LogManager.Setup() allows fluent configuration of LogFactory options (@snakefoot + @304NotModified) - [#3610](https://github.com/NLog/NLog/pull/3610) LogManager.Setup().SetupSerialization(s => s.RegisterObjectTransformation(...)) for overriding default property reflection (@snakefoot + @304NotModified + @Giorgi + @mmurrell) -- [#3787](https://github.com/NLog/NLog/pull/3787) LogManager.Setup().SetupSerialization(s => s.RegisterConditionMethod(...)) can use lambda methods and not just static methods (@snakefoot) +- [#3787](https://github.com/NLog/NLog/pull/3787) LogManager.Setup().SetupExtensions(s => s.RegisterConditionMethod(...)) can use lambda methods and not just static methods (@snakefoot) - [#3713](https://github.com/NLog/NLog/pull/3713) ${level:format=FullName} will expand Info + Warn to their full name (@snakefoot) - [#3714](https://github.com/NLog/NLog/pull/3714) + [#3734](https://github.com/NLog/NLog/pull/3734) FileTarget - Supports MaxArchiveDays for cleanup of old files based on their age (@snakefoot) - [#3737](https://github.com/NLog/NLog/pull/3737) + [#3769](https://github.com/NLog/NLog/pull/3769) Layout.FromMethod to create Layout directly from a lambda method (@snakefoot) - [#3771](https://github.com/NLog/NLog/pull/3771) Layout.FromString to create Layout directly from string along with optional parser validation (@snakefoot) - [#3793](https://github.com/NLog/NLog/pull/3793) ${dir-separator} for rendering platform specific directory path separator (@304NotModified) - [#3755](https://github.com/NLog/NLog/pull/3755) FileTarget - Supports ArchiveOldFileOnStartupAboveSize for cleanup of existing file when above size (@Sam13) -- [#3796](https://github.com/NLog/NLog/pull/3796) InternalLogger: added LogMessageReceived event (@304NotModified) +- [#3796](https://github.com/NLog/NLog/pull/3796) + [#3823](https://github.com/NLog/NLog/pull/3823) InternalLogger - Added LogMessageReceived event (@304NotModified + @snakefoot) +- [#3829](https://github.com/NLog/NLog/pull/3829) DatabaseTarget - Assign connection properties like SqlConnection.AccessToken (@304NotModified + @snakefoot) +- [#3839](https://github.com/NLog/NLog/pull/3839) DatabaseTarget - Assign command properties like SqlCommand.CommandTimeout (@snakefoot) +- [#3833](https://github.com/NLog/NLog/pull/3833) ${onHasProperties} for only rendering when logevent includes properties from structured logging (@snakefoot) - -#### Improvements +**Improvements** - [#3521](https://github.com/NLog/NLog/pull/3521) XmlLoggingConfiguration - Marked legacy constructors with ignoreErrors parameter as obsolete (@snakefoot) - [#3689](https://github.com/NLog/NLog/pull/3689) LoggingConfiguration - Perform checking of unused targets during initialization for better validation (@snakefoot) - [#3704](https://github.com/NLog/NLog/pull/3704) EventLogTarget - Improve diagnostics logging when using dynamic EventLog source (@snakefoot) @@ -32,13 +926,16 @@ Date format: (year/month/day) - [#3754](https://github.com/NLog/NLog/pull/3754) LocalIpAddressLayoutRenderer - Higher priority to network-addresses that has valid gateway adddress (@snakefoot) - [#3762](https://github.com/NLog/NLog/pull/3762) LogFactory - Flush reports to InternalLogger what targets produces timeouts (@snakefoot) -#### Bugfixes +**Fixes** - [#3758](https://github.com/NLog/NLog/pull/3758) LogFactory - Fix deadlock issue with AutoReload (@snakefoot) - [#3766](https://github.com/NLog/NLog/pull/3766) JsonLayout - Fixed ThreadAgnostic to correctly capture context when using nested JsonLayout (@snakefoot) - [#3700](https://github.com/NLog/NLog/pull/3700) ExceptionLayoutRenderer - Fixed so Format option HResult also works for NetCore (@snakefoot) - [#3761](https://github.com/NLog/NLog/pull/3761) + [#3784](https://github.com/NLog/NLog/pull/3784) Log4JXml Layout will render NDLC + NDC scopes in correct order (@adanek + @304NotModified) +- [#3821](https://github.com/NLog/NLog/pull/3821) Logger - Added exception handler for CallSite capture for platform that fails to capture StackTrace (@snakefoot) +- [#3835](https://github.com/NLog/NLog/pull/3835) StringSplitter - Fixed quote handling when reading elements for config list-properties (@snakefoot) +- [#3828](https://github.com/NLog/NLog/pull/3828) Utilities: fix ConversionHelpers.TryParseEnum for white space (@304NotModified) -#### Performance +**Performance** - [#3683](https://github.com/NLog/NLog/pull/3683) ObjectGraphScanner - Avoid holding list.SyncRoot lock while scanning (@snakefoot) - [#3691](https://github.com/NLog/NLog/pull/3691) FileTarget - ConcurrentWrites=true on NetCore now much faster when archive enabled (@snakefoot) - [#3694](https://github.com/NLog/NLog/pull/3694) + [#3705](https://github.com/NLog/NLog/pull/3705) JsonConverter - Write DateTime directly without string allocation (@snakefoot) @@ -47,13 +944,16 @@ Date format: (year/month/day) - [#3739](https://github.com/NLog/NLog/pull/3739) NetworkTarget - Reduced memory allocation for encoding into bytes without string allocation (@snakefoot) - [#3748](https://github.com/NLog/NLog/pull/3748) AsyncTaskTarget - Skip default AsyncWrapper since already having internal queue (@snakefoot) - [#3767](https://github.com/NLog/NLog/pull/3767) Mark Condition Expressions as ThreadSafe to improve concurrency in Layouts (@snakefoot) -- [#3713](https://github.com/NLog/NLog/pull/3713) DatabaseTarget - Added IsolationLevel option that activates transactions for better batching performance (@snakefoot) +- [#3764](https://github.com/NLog/NLog/pull/3764) DatabaseTarget - Added IsolationLevel option that activates transactions for better batching performance (@snakefoot) - [#3779](https://github.com/NLog/NLog/pull/3779) SimpleLayout - Assignment of string-reference with null-value will translate into FixedText (@304NotModified) - [#3790](https://github.com/NLog/NLog/pull/3790) AsyncWrapper - Less aggressive with scheduling timer events for background writing (@snakefoot) +- [#3830](https://github.com/NLog/NLog/pull/3830) Faster assignment of properties accessed through reflection (@304NotModified) +- [#3832](https://github.com/NLog/NLog/pull/3832) ${replace} - Faster search and replace when not explicitly have requested regex support (@snakefoot) +- [#3828](https://github.com/NLog/NLog/pull/3828) Skip need for Activator.CreateInstance in DbTypeSetter (@304NotModified) -### V4.6.8 (2019/11/04) +### Version 4.6.8 (2019/11/04) -#### Bugfixes +**Fixes** - [#3566](https://github.com/NLog/NLog/pull/3566) DatabaseTarget - Auto escape special chars in password, and improve handling of empty username/password (@304NotModified) - [#3584](https://github.com/NLog/NLog/pull/3584) LoggingRule - Fixed IndexOutOfRangeException for SetLoggingLevels with LogLevel.Off (@snakefoot) - [#3609](https://github.com/NLog/NLog/pull/3609) FileTarget - Improved handling of relative path in ArchiveFileName (@snakefoot) @@ -61,7 +961,7 @@ Date format: (year/month/day) - [#3647](https://github.com/NLog/NLog/pull/3647) ${substring} - Length should not be mandatory (@304NotModified) - [#3653](https://github.com/NLog/NLog/pull/3653) SimpleLayout - Fixed NullReferenceException in PreCalculate during TryGetRawValue optimization (@snakefoot) -#### Features +**Features** - [#3578](https://github.com/NLog/NLog/pull/3578) LogFactory - AutoShutdown can be configured to unhook from AppDomain-Unload, and avoid premature shutdown with IHostBuilder (@snakefoot) - [#3579](https://github.com/NLog/NLog/pull/3579) PerformanceCounterLayoutRenderer - Added Layout-support for Instance-property (@snakefoot) - [#3583](https://github.com/NLog/NLog/pull/3583) ${local-ip} Layout Renderer for local machine ip-address (@snakefoot + @304NotModified) @@ -70,7 +970,7 @@ Date format: (year/month/day) - [#3593](https://github.com/NLog/NLog/pull/3593) AllEventPropertiesLayoutRenderer - Added Exclude-option that specifies property-keys to skip (@snakefoot) - [#3611](https://github.com/NLog/NLog/pull/3611) ${Exception} - Added new Format-option values HResult and Properties (@snakefoot) -#### Improvements +**Improvements** - [#3622](https://github.com/NLog/NLog/pull/3622) + [#3651](https://github.com/NLog/NLog/pull/3651) ConcurrentRequestQueue refactoring to reduce code complexity (@snakefoot) - [#3636](https://github.com/NLog/NLog/pull/3636) AsyncTargetWrapper now fallback to clearing internal queue if flush fails to release blocked writer threads (@snakefoot) - [#3641](https://github.com/NLog/NLog/pull/3641) ${CallSite} - Small improvements for recognizing async callsite cases (@snakefoot) @@ -81,22 +981,22 @@ Date format: (year/month/day) - [#3660](https://github.com/NLog/NLog/pull/3660) ObjectHandleSerializer.GetObjectData includes SerializationFormatter=true for use in MDLC + NDLC (@snakefoot) - [#3662](https://github.com/NLog/NLog/pull/3662) FileTarget - Extra logging when FileName Layout renders empty string (@snakefoot) -#### Performance +**Performance** - [#3618](https://github.com/NLog/NLog/pull/3618) LogFactory - Faster initial assembly reflection and config loading (@snakefoot) - [#3635](https://github.com/NLog/NLog/pull/3635) ConsoleTarget - Added WriteBuffer option that allows batch writing to console-stream with reduced allocations (@snakefoot) - [#3635](https://github.com/NLog/NLog/pull/3635) ConsoleTarget - Added global lock to prevent any threadsafety issue from unsafe console (@snakefoot) -### V4.6.7 (2019/08/25) +### Version 4.6.7 (2019/08/25) -#### Features +**Features** - [#3531](https://github.com/NLog/NLog/pull/3531) Added ${object-path} / ${exception:objectpath=PropertyName}, for rendering a property of an object (e.g. an exception) (#3531) (@304NotModified) - [#3560](https://github.com/NLog/NLog/pull/3560) WhenMethodFilter - Support dynamic filtering using lambda (#3560) (@snakefoot) - [#3184](https://github.com/NLog/NLog/pull/3184) Added support for dynamic layout renderer in log level filters (e.g. minLevel, maxLevel) (#3184) (@snakefoot) - [#3558](https://github.com/NLog/NLog/pull/3558) ExceptionLayoutRenderer - Added Source as new format parameter. (@snakefoot) - [#3523](https://github.com/NLog/NLog/pull/3523) ColoredConsoleTarget - Added DetectOutputRedirected to skip coloring on redirect (@snakefoot) -#### Improvements +**Improvements** - [#3541](https://github.com/NLog/NLog/pull/3541) MessageTemplateParameters - Improve validation of parameters when isPositional (#3541) (@snakefoot) - [#3546](https://github.com/NLog/NLog/pull/3546) NetworkTarget - HttpNetworkSender no longer sends out-of-order (@snakefoot) @@ -104,30 +1004,30 @@ Date format: (year/month/day) - [#3562](https://github.com/NLog/NLog/pull/3562) XML config - Support ThrowConfigExceptions=true even when xml is invalid (@snakefoot) - [#3532](https://github.com/NLog/NLog/pull/3532) Fix summary of NoRawValueLayoutRendererWrapper class (#3532) (@304NotModified) -#### Performance +**Performance** - [#3540](https://github.com/NLog/NLog/pull/3540) MessageTemplateParameters - Skip object allocation when no parameters (@snakefoot) - [#3527](https://github.com/NLog/NLog/pull/3527) XmlLayout - Defer allocation of ObjectReflectionCache until needed (#3527) (@snakefoot) -### V4.6.6 (2019/07/14) +### Version 4.6.6 (2019/07/14) -#### Features +**Features** - [#3514](https://github.com/NLog/NLog/pull/3514) Added XmlLoggingConfiguration(XmlReader reader) ctor, improved docs and annotations (@dmitrychilli, @304NotModified) - [#3513](https://github.com/NLog/NLog/pull/3513) AutoFlushTargetWrapper - Added FlushOnConditionOnly property (@snakefoot) -#### Performance +**Performance** - [#3492](https://github.com/NLog/NLog/pull/3492) FileTarget - improvements when ConcurrentWrites=false (@snakefoot) -### V4.6.5 (2019/06/13) +### Version 4.6.5 (2019/06/13) -#### Bugfixes +**Fixes** - [#3476](https://github.com/NLog/NLog/pull/3476) Fix broken XSD schema - NLog.Schema package (@snakefoot, @304NotModified) -#### Features +**Features** - [#3478](https://github.com/NLog/NLog/pull/3478) XSD: Support `` in `` (@304NotModified) - [#3477](https://github.com/NLog/NLog/pull/3477) ${AppSetting} - Added support for ConnectionStrings Lookup (@snakefoot) @@ -135,23 +1035,23 @@ Date format: (year/month/day) - [#3453](https://github.com/NLog/NLog/pull/3453) Added null terminator line ending for network target (@Kahath) - [#3442](https://github.com/NLog/NLog/pull/3442) Log4JXmlEventLayout - Added IncludeCallSite + IncludeSourceInfo (@snakefoot) -#### Improvements +**Improvements** - [#3482](https://github.com/NLog/NLog/pull/3482) Fix typos in docs and comments (@304NotModified) -#### Performance +**Performance** - [#3444](https://github.com/NLog/NLog/pull/3444) RetryingMultiProcessFileAppender - better init BufferSize (@snakefoot) -### V4.6.4 (2019/05/28) +### Version 4.6.4 (2019/05/28) -#### Bugfixes +**Fixes** - [#3392](https://github.com/NLog/NLog/pull/3392) NLog.Schema: Added missing defaultAction attribute on filters element in XSD (@304NotModified) - [#3415](https://github.com/NLog/NLog/pull/3415) AsyncWrapper in Blocking Mode can cause deadlock (@snakefoot) -#### Features +**Features** - [#3430](https://github.com/NLog/NLog/pull/3430) Added "Properties" property on Logger for reading and editing properties.(@snakefoot, @304NotModified) - [#3423](https://github.com/NLog/NLog/pull/3423) ${all-event-properties}: Added IncludeEmptyValues option (@304NotModified) @@ -161,12 +1061,12 @@ Date format: (year/month/day) - [#3389](https://github.com/NLog/NLog/pull/3389) Log4JXmlEventLayout - Added support for configuration of Parameters (@snakefoot) - [#3411](https://github.com/NLog/NLog/pull/3411) LoggingConfigurationParser - Recognize LoggingRule.RuleName property (@snakefoot) -#### Improvements +**Improvements** - [#3393](https://github.com/NLog/NLog/pull/3393) Update package descriptions to note the issues with `` (@304NotModified) - [#3409](https://github.com/NLog/NLog/pull/3409) Various XSD improvements (NLog.Schema package) (@304NotModified) -#### Performance +**Performance** - [#3398](https://github.com/NLog/NLog/pull/3398) ${whenEmpty} faster rendering of string values (@snakefoot, @304NotModified) - [#3405](https://github.com/NLog/NLog/pull/3405) FilteringTargetWrapper: Add support for batch writing (@snakefoot, @304NotModified) @@ -174,14 +1074,14 @@ Date format: (year/month/day) - [#3435](https://github.com/NLog/NLog/pull/3435) Async / buffering wrapper: Improve performance when blocking (@snakefoot) - [#3434](https://github.com/NLog/NLog/pull/3434) ObjectReflectionCache - Skip property-reflection for IFormattable (@snakefoot) -### V4.6.3 (2019/04/30) +### Version 4.6.3 (2019/04/30) -#### Bugfixes +**Fixes** - [#3345](https://github.com/NLog/NLog/pull/3345) Fixed potential memory issue and message duplication with large strings (@snakefoot) - [#3316](https://github.com/NLog/NLog/pull/3316) TargetWithContext - serialize MDC and MDLC values properly (@304NotModified) -#### Features +**Features** - [#3298](https://github.com/NLog/NLog/pull/3298) Added WithProperty and SetProperty on Logger (@snakefoot) - [#3329](https://github.com/NLog/NLog/pull/3329) ${EventProperties} - Added ObjectPath for rendering nested property (@snakefoot, @304NotModified) @@ -189,36 +1089,36 @@ Date format: (year/month/day) - [#3328](https://github.com/NLog/NLog/pull/3328) Added truncate ambient property, e.g. ${message:truncate=80} (@snakefoot) - [#3278](https://github.com/NLog/NLog/pull/3278) ConsoleTarget & ColoredConsoleTarget - Added AutoFlush and improve default flush behavior (@snakefoot) -#### Improvements +**Improvements** - [#3322](https://github.com/NLog/NLog/pull/3322) FileTarget - Introduced EnableFileDeleteSimpleMonitor without FileSystemWatcher for non-Windows (@snakefoot) - [#3332](https://github.com/NLog/NLog/pull/3332) LogFactory - GetLogger should validate name of logger (@snakefoot) - [#3320](https://github.com/NLog/NLog/pull/3320) FallbackGroupTarget - Fixed potential issue with WINDOWS_PHONE (@snakefoot) - [#3261](https://github.com/NLog/NLog/pull/3261) NLog config file loading: use process name (e.g. applicationname.exe.nlog) when app.config is not available (@snakefoot) -#### Performance +**Performance** - [#3311](https://github.com/NLog/NLog/pull/3311) Split string - avoid allocation of object array. Added StringHelpers.SplitAndTrimTokens (@snakefoot) - [#3305](https://github.com/NLog/NLog/pull/3305) AppSettingLayoutRenderer - Mark as ThreadSafe and ThreadAgnostic (@snakefoot) -#### Misc +**Other** - [#3338](https://github.com/NLog/NLog/pull/3338) Update docs of various context classes (@304NotModified) - [#3288](https://github.com/NLog/NLog/pull/3288) Move NLogPackageLoaders for better unittest debugging experience of NLog (@304NotModified) - [#3274](https://github.com/NLog/NLog/pull/3274) Make HttpNetworkSender mockable, add unit test, introduce NSubsitute (@304NotModified) - 10 pull requests with refactorings (@snakefoot, @304NotModified) -### V4.6.2 (2019/04/02) +### Version 4.6.2 (2019/04/02) -#### Bugfixes +**Fixes** - [#3260](https://github.com/NLog/NLog/pull/3260) Fix escaping nested close brackets when parsing layout renderers (@lobster2012-user) - [#3271](https://github.com/NLog/NLog/pull/3271) NLog config - Fixed bug where empty xml-elements were ignored (@snakefoot, @jonreis) -### V4.6.1 (2019/03/29) +### Version 4.6.1 (2019/03/29) -#### Bugfixes +**Fixes** - [#3199](https://github.com/NLog/NLog/pull/3199) LoggingConfigurationParser - Fixed bug in handling of extensions prefix (@snakefoot) - [#3253](https://github.com/NLog/NLog/pull/3253) Fix wrong warnings on `` element (only wrong warnings) (#3253) (@snakefoot, @304NotModified) @@ -227,19 +1127,19 @@ Date format: (year/month/day) - [#3191](https://github.com/NLog/NLog/pull/3191) VariableLayoutRenderer - Fixed format-string for internal logger warning (@snakefoot, @lobster2012-user) - [#3258](https://github.com/NLog/NLog/pull/3258) Fix error with Embedded Assembly in LogAssemblyVersion (@snakefoot) -#### Improvements +**Improvements** - [#3255](https://github.com/NLog/NLog/pull/3255) Auto-flush on process exit improvements (@snakefoot) - [#3189](https://github.com/NLog/NLog/pull/3189) AsyncTaskTarget - Respect TaskDelayMilliseconds on low activity (@snakefoot) -#### Performance +**Performance** - [#3256](https://github.com/NLog/NLog/pull/3256) ${NDLC} + ${NDC} - Faster checking when TopFrames = 1 (@snakefoot) - [#3201](https://github.com/NLog/NLog/pull/3201) ${GDC} reading is now lockfree (#3201) (@snakefoot) -### V4.6 +### Version 4.6 -#### Features +**Features** - [#2363](https://github.com/NLog/NLog/pull/2363) + [#2899](https://github.com/NLog/NLog/pull/2899) + [#3085](https://github.com/NLog/NLog/pull/3085) + [#3091](https://github.com/NLog/NLog/pull/3091) Database target: support for DbType for parameters (including SqlDbType) - (@hubo0831,@ObikeDev,@sorvis, @304NotModified, @snakefoot) - [#2610](https://github.com/NLog/NLog/pull/2610) AsyncTargetWrapper with LogEventDropped- + LogEventQueueGrow-events (@Pomoinytskyi) @@ -263,7 +1163,7 @@ Date format: (year/month/day) * [#3165](https://github.com/NLog/NLog/pull/3165) Added noRawValue layout wrapper (@snakefoot) -#### Enhancements +**Improvements** - [#2989](https://github.com/NLog/NLog/pull/2989) JsonLayout includes Type-property when rendering Exception-object (@snakefoot) - [#2891](https://github.com/NLog/NLog/pull/2891) LoggingConfigurationParser - Extracted from XmlLoggingConfiguration (Prepare for appsettings.json) (@snakefoot) @@ -282,7 +1182,7 @@ Date format: (year/month/day) - [#3187](https://github.com/NLog/NLog/pull/3187) AsyncTaskTarget - Fixed unwanted delay caused by slow writer (@snakefoot) - Various refactorings (19 pull requests) (@beppemarazzi, @304NotModified, @snakefoot) -#### Performance +**Performance** - [#2650](https://github.com/NLog/NLog/pull/2650) AsyncTargetWrapper using ConcurrentQueue for NetCore2 for better thread-concurrency (@snakefoot) - [#2890](https://github.com/NLog/NLog/pull/2890) AsyncTargetWrapper - TimeToSleepBetweenBatches changed default to 1ms (@snakefoot) @@ -299,60 +1199,60 @@ Date format: (year/month/day) See also [NLog 4.6 Milestone](https://github.com/NLog/NLog/milestone/44?closed=1) -### V4.5.11 (2018/11/06) +### Version 4.5.11 (2018/11/06) -#### Enhancements +**Improvements** - [#2985](https://github.com/NLog/NLog/pull/2985) LogBuilder - Support fluent assignment of message-template after properties (@snakefoot) - [#2983](https://github.com/NLog/NLog/pull/2983) JsonSerializer - Use ReferenceEquals instead of object.Equals when checking for cyclic object loops (#2983) (@snakefoot) - [#2988](https://github.com/NLog/NLog/pull/2988) NullAppender - Added missing SecuritySafeCritical (@snakefoot) -#### Fixes +**Fixes** - [#2987](https://github.com/NLog/NLog/pull/2987) JSON encoding should create valid JSON for non-string dictionary-keys (@snakefoot) -### V4.5.10 (2018/09/17) +### Version 4.5.10 (2018/09/17) -#### Fixes +**Fixes** - [#2883](https://github.com/NLog/NLog/pull/2883) Fix LoadConfiguration for not found config file (@snakefoot, @304NotModified) -### v4.5.9 (2018/08/24) +### Version 4.5.9 (2018/08/24) -#### Fixes +**Fixes** - [#2865](https://github.com/NLog/NLog/pull/2865) JSON encoding should create valid JSON for special double values (@snakefoot) -#### Enhancements +**Improvements** - [#2846](https://github.com/NLog/NLog/pull/2846) Include Entry Assembly File Location when loading candidate NLog.config (@snakefoot) -### v4.5.8 (2018/08/05) +### Version 4.5.8 (2018/08/05) -#### Features +**Features** - [#2809](https://github.com/NLog/NLog/pull/2809) MethodCallTarget - Support for Lamba method (@snakefoot) - [#2816](https://github.com/NLog/NLog/pull/2816) MessageTemplates - Support rendering of alignment + padding (@snakefoot) -#### Fixes +**Fixes** - [#2827](https://github.com/NLog/NLog/pull/2827) FileTarget - Failing to CreateArchiveMutex should not stop logging (@snakefoot) - [#2830](https://github.com/NLog/NLog/pull/2830) Auto loading of assemblies was broken in some cases (@snakefoot) -#### Enhancements +**Improvements** - [#2814](https://github.com/NLog/NLog/pull/2814) LoggingConfiguration - Improves CheckUnusedTargets to handle target wrappers (@snakefoot) -#### Performance +**Performance** - [#2817](https://github.com/NLog/NLog/pull/2817) Optimize LayoutRendererWrappers to reduce string allocations (#2817) (@snakefoot) -### v4.5.7 (2018/07/19) +### Version 4.5.7 (2018/07/19) -#### Features +**Features** - [#2792](https://github.com/nlog/nlog/pull/2792) OutputDebugStringTarget - Support Xamarin iOS and Android (@snakefoot) - [#2776](https://github.com/nlog/nlog/pull/2776) FileTarget - Introduced OpenFileFlushTimeout to help when AutoFlush = false (@snakefoot) -#### Fixes +**Fixes** - [#2761](https://github.com/nlog/nlog/pull/2761) ${Callsite} fix class naming when includeNamespace=false and cleanNamesOfAnonymousDelegates=true (@Azatey) - [#2752](https://github.com/nlog/nlog/pull/2752) JSON: Fixes issue where char types are not properly escaped (#2752) (@smbecker) -#### Enhancements +**Improvements** - [#2804](https://github.com/nlog/nlog/pull/2804) FileTarget - Do not trust Last File Write TimeStamp when AutoFlush=false (@snakefoot) - [#2763](https://github.com/nlog/nlog/pull/2763) Throw better error when target name is null (@masters3d) @@ -360,57 +1260,57 @@ See also [NLog 4.6 Milestone](https://github.com/NLog/NLog/milestone/44?closed=1 - [#2756](https://github.com/nlog/nlog/pull/2756) LongDateLayoutRenderer: Improve comments (@stic) - [#2749](https://github.com/nlog/nlog/pull/2749) NLog.WindowsEventLog: Update dependency System.Diagnostics.EventLog to RTM version (@304NotModified) -#### Performance +**Performance** - [#2797](https://github.com/nlog/nlog/pull/2797) Better performance with Activator.CreateInstance (@tangdf) -### v4.5.6 (2018/05/29) +### Version 4.5.6 (2018/05/29) -#### Fixes +**Fixes** - [#2747](https://github.com/nlog/nlog/pull/2747) JsonSerializer - Generate valid Json when hitting the MaxRecursionLimit (@snakefoot) - Fixup for [NLog.WindowsEventLog package](https://www.nuget.org/packages/NLog.WindowsEventLog) -#### Enhancements +**Improvements** - [#2745](https://github.com/nlog/nlog/pull/2745) FileTarget - Improve support for Linux FileSystem without BirthTime (@snakefoot) -#### Performance +**Performance** - [#2744](https://github.com/nlog/nlog/pull/2744) LogEventInfo - HasProperties should allocate PropertiesDicitonary when needed (@snakefoot) - [#2743](https://github.com/nlog/nlog/pull/2743) JsonLayout - Reduce allocations when needing to escape string (44% time improvement) (@snakefoot) -### v4.5.5 (2018/05/25) +### Version 4.5.5 (2018/05/25) -#### Fixes +**Fixes** - [#2736](https://github.com/NLog/NLog/pull/2736) FileTarget - Calculate correct archive date when multiple file appenders (@snakefoot) -#### Features +**Features** - [#2726](https://github.com/nlog/nlog/pull/2726) WhenRepeated - Support logging rules with multiple targets (@snakefoot) - [#2727](https://github.com/nlog/nlog/pull/2727) Support for custom targets that implements IUsesStackTrace (@snakefoot) - [#2719](https://github.com/nlog/nlog/pull/2719) DatabaseTarget: use parameters on install (@Jejuni) -#### Enhancements +**Improvements** - [#2718](https://github.com/nlog/nlog/pull/2718) JsonLayout - Always stringify when requested (@snakefoot) - [#2739](https://github.com/nlog/nlog/pull/2739) Target.WriteAsyncLogEvents(IList) to public -#### Performance +**Performance** - [#2704](https://github.com/nlog/nlog/pull/2704) Allocation improvement in precalculating layouts (@snakefoot) -### v4.5.4 (2018/05/05) +### Version 4.5.4 (2018/05/05) -#### Fixes +**Fixes** - [#2688](https://github.com/nlog/nlog/pull/2688) Faulty invalidate of FormattedMessage when getting PropertiesDictionary (@snakefoot) - [#2687](https://github.com/nlog/nlog/pull/2687) Fix: NLog.config build-action and copy for non-core projects, it's now "copy if newer" (@304NotModified) - [#2698](https://github.com/nlog/nlog/pull/2698) FileTarget - Calculate correct archive date, when using Monthly archive (@snakefoot) -#### Enhancements +**Improvements** - [#2673](https://github.com/nlog/nlog/pull/2673) TargetWithContext - Easier to use without needing to override ContextProperties (@snakefoot) - [#2684](https://github.com/nlog/nlog/pull/2684) DatabaseTarget - Skip static assembly lookup for .Net Standard (@snakefoot) @@ -419,46 +1319,46 @@ See also [NLog 4.6 Milestone](https://github.com/NLog/NLog/milestone/44?closed=1 - [#2586](https://github.com/nlog/nlog/pull/2586) Target.MergeEventProperties is now obsolete (@snakefoot) - Sonar warning fixes: [#2691](https://github.com/nlog/nlog/pull/2691), [#2694](https://github.com/nlog/nlog/pull/2694), [#2693](https://github.com/nlog/nlog/pull/2693), [#2690](https://github.com/nlog/nlog/pull/2690), [#2685](https://github.com/nlog/nlog/pull/2685), [#2683](https://github.com/nlog/nlog/pull/2683), [#2696](https://github.com/NLog/NLog/pull/2696) (@snakefoot, @304NotModified) -### v4.5.3 (2018/04/16) +### Version 4.5.3 (2018/04/16) -#### Fixes +**Fixes** - [#2662](https://github.com/nlog/nlog/pull/2662) FileTarget - Improve handling of archives with multiple active files (@snakefoot) -#### Enhancements +**Improvements** - [#2587](https://github.com/nlog/nlog/pull/2587) Internal Log - Include target type and target name in the log messages (@snakefoot) - [#2651](https://github.com/nlog/nlog/pull/2651) Searching for NLog Extension Files should handle DirectoryNotFoundException (@snakefoot) -#### Performance +**Performance** - [#2653](https://github.com/nlog/nlog/pull/2653) LayoutRenderer ThreadSafe Attribute introduced to allow lock free Precalculate + other small performance improvements (@snakefoot) -### v4.5.2 (2018/04/06) +### Version 4.5.2 (2018/04/06) -#### Features +**Features** - [#2648](https://github.com/nlog/nlog/pull/2648) ${processtime} and ${time} added invariant option (@snakefoot) -#### Fixes +**Fixes** - [#2643](https://github.com/nlog/nlog/pull/2643) UWP with NetStandard2 on Net Native does not support Assembly.CodeBase + Handle native methods in StackTrace (#2643) (@snakefoot) - [#2644](https://github.com/nlog/nlog/pull/2644) FallbackGroupTarget: handle async state on fallback correctly (@snakefoot) -#### Performance +**Performance** - [#2645](https://github.com/nlog/nlog/pull/2645) Minor performance optimization of some layoutrenderers (@snakefoot) - [#2642](https://github.com/nlog/nlog/pull/2642) FileTarget - InitializeFile should skip dictionary lookup when same file (@snakefoot) -### v4.5.1 (2018/04/03) +### Version 4.5.1 (2018/04/03) -#### Fixes +**Fixes** - [#2637](https://github.com/nlog/nlog/pull/2637) Fix IndexOutOfRangeException in NestedDiagnosticsLogicalContext (@snakefoot) - [#2638](https://github.com/nlog/nlog/pull/2638) Handle null values correctly in LogReceiverSecureService (@304NotModified) -#### Performance +**Performance** - [#2639](https://github.com/nlog/nlog/pull/2639) MessageTemplates - Optimize ParseHole for positional templates (@snakefoot) - [#2640](https://github.com/nlog/nlog/pull/2640) FileTarget - InitializeFile no longer need justData parameter + dispose fileapenders earlier (@snakefoot) @@ -467,14 +1367,14 @@ See also [NLog 4.6 Milestone](https://github.com/NLog/NLog/milestone/44?closed=1 -### v4.5 RTM (2018/03/25) +### Version 4.5 RTM (2018/03/25) NLog 4.5 adds structured logging and .NET Standard support/UPW without breaking changes! Also a lot features has been added! List of important changes in NLog 4.5 -#### Features +**Features** - Support for .Net Standard 2.0 [#2263](https://github.com/nlog/nlog/pull/2263) + [#2402](https://github.com/nlog/nlog/pull/2402) (@snakefoot) - Support for .Net Standard 1.5 [#2341](https://github.com/nlog/nlog/pull/2341) (@snakefoot) @@ -505,7 +1405,7 @@ List of important changes in NLog 4.5 - MDC + MDLC with SetScoped property support [#2592](https://github.com/nlog/nlog/pull/2592) (@MikeFH) - LoggingConfiguration AddRule includes final-parameter [#2612](https://github.com/nlog/nlog/pull/2612) (@893949088) -#### Fixes +**Fixes** - Improve archive stability during concurrent file access [#1889](https://github.com/nlog/nlog/pull/1889) (@snakefoot) - FallbackGroup could lose log events [#2265](https://github.com/nlog/nlog/pull/2265) (@frabar666) - ${exception} - only include separator when items are available [#2257](https://github.com/nlog/nlog/pull/2257) (@jojosardez) @@ -522,7 +1422,7 @@ List of important changes in NLog 4.5 - FileTarget does not fail on platforms without global mutex support [#2604](https://github.com/nlog/nlog/pull/2604) (@snakefoot) - LoggingConfiguration does not fail when AutoReload is not possible on the platforms without FileWatcher [#2603](https://github.com/nlog/nlog/pull/2603) (@snakefoot) -#### Performance +**Performance** - More targets has OptimizeBufferReuse enabled by default [#1913](https://github.com/nlog/nlog/pull/1913) + [#1923](https://github.com/nlog/nlog/pull/1923) + [#1912](https://github.com/nlog/nlog/pull/1912) + [#1911](https://github.com/nlog/nlog/pull/1911) + [#1910](https://github.com/nlog/nlog/pull/1910) + [#1909](https://github.com/nlog/nlog/pull/1909) + [#1908](https://github.com/nlog/nlog/pull/1908) + [#1907](https://github.com/nlog/nlog/pull/1907) + [#2560](https://github.com/nlog/nlog/pull/2560) (@snakefoot) - StringBuilderPool - Improved Layout Render Performance by reusing StringBuilders [#2208](https://github.com/nlog/nlog/pull/2208) (@snakefoot) - JsonLayout - Improved Layout Performance, by optimizing use of StringBuilder [#2208](https://github.com/nlog/nlog/pull/2208) (@snakefoot) @@ -530,9 +1430,6 @@ List of important changes in NLog 4.5 - Target - Precalculate Layout should ignore sub-layouts for complex layout (Ex Json) [#2378](https://github.com/nlog/nlog/pull/2378) (@snakefoot) - MessageLayoutRenderer - Skip `string.Format` allocation (for caching) when writing to a single target, instead format directly into output buffer. [#2507](https://github.com/nlog/nlog/pull/2507) (@snakefoot) - - - Changes since rc 07: - [#2621](https://github.com/nlog/nlog/pull/2621) Single Target optimization logic refactored to reuse optimization approval (@snakefoot) - [#2622](https://github.com/nlog/nlog/pull/2622) NetworkTarget - Http / Https should not throw on async error response (@snakefoot) @@ -540,7 +1437,7 @@ Changes since rc 07: - [#2616](https://github.com/nlog/nlog/pull/2616) LogManager.Shutdown - Should disable file watcher and avoid auto reload (@snakefoot) - [#2620](https://github.com/nlog/nlog/pull/2620) Single Target optimization should only be done when parseMessageTemplate = null (@snakefoot) -### v4.5-rc07 (2018/03/07) +### Version 4.5-rc07 (2018/03/07) - [#2614](https://github.com/nlog/nlog/pull/2614) NLog 4.5 RC7 changelog & version (@304NotModified) - [#2612](https://github.com/nlog/nlog/pull/2612) add final param to `AddRule` Methods (#2612) (@893949088) - [#2590](https://github.com/nlog/nlog/pull/2590) WebServiceTarget - JsonPost with support for single nameless parameter (@snakefoot) @@ -554,13 +1451,13 @@ Changes since rc 07: - [#2613](https://github.com/nlog/nlog/pull/2613) Attempt to make some unit-tests more stable (@snakefoot) - [#2603](https://github.com/nlog/nlog/pull/2603) MultiFileWatcher - Improve error handling if FileSystemWatcher fails (@snakefoot) -### v4.5-rc06 (2018/02/20) +### Version 4.5-rc06 (2018/02/20) - [#2585](https://github.com/nlog/nlog/pull/2585) NLog 4.5 rc6 version and changelog (#2585) (@304NotModified) - [#2581](https://github.com/nlog/nlog/pull/2581) MessageTemplateParameter(s) ctors to internal (@304NotModified) - [#2576](https://github.com/nlog/nlog/pull/2576) Fix possible infinite loop in message template parser + better handling incorrect templates (@304NotModified) - [#2580](https://github.com/nlog/nlog/pull/2580) ColoredConsoleTarget.cs: Fix typo (@perlun) -### v4.5-rc05 (2018/02/13) +### Version 4.5-rc05 (2018/02/13) - [#2571](https://github.com/nlog/nlog/pull/2571) 4.5 rc5 version and release notes (@304NotModified) - [#2572](https://github.com/nlog/nlog/pull/2572) copyright 2018 (@304NotModified) - [#2570](https://github.com/nlog/nlog/pull/2570) Update nuspec NLog.Config and NLog.Schema (@304NotModified) @@ -583,7 +1480,7 @@ Changes since rc 07: - [#2518](https://github.com/nlog/nlog/pull/2518) DatabaseTarget - Added DbProvider System.Data.SqlClient for NetStandard (@snakefoot) - [#2514](https://github.com/nlog/nlog/pull/2514) Added missing docgen for different options (Less noise in appveyor) (@snakefoot) -### v4.5-rc04 (2018/01/15) +### Version 4.5-rc04 (2018/01/15) - [#2490](https://github.com/nlog/nlog/pull/2490) LogEventInfo.MessageTemplateParameters as class instead of interface (#2490) (@snakefoot) - [#2510](https://github.com/nlog/nlog/pull/2510) Database target entity framework connection string (@snakefoot) - [#2513](https://github.com/nlog/nlog/pull/2513) Update docs for [AppDomainFixedOutput], remove [AppDomainFixedOutput] on ${currentDir} (@NLog) @@ -604,7 +1501,7 @@ Changes since rc 07: - [#2471](https://github.com/nlog/nlog/pull/2471) TreatWarningsAsErrors = true (@snakefoot) - [#2462](https://github.com/nlog/nlog/pull/2462) AsyncLogEventInfo - Removed private setter (@snakefoot) -### v4.5-rc03 (2017/12/11) +### Version 4.5-rc03 (2017/12/11) - [#2460](https://github.com/nlog/nlog/pull/2460) NLog 4.5 rc3 version and changelog (@304NotModified) - [#2459](https://github.com/nlog/nlog/pull/2459) StringBuilderExt.CopyToStream - Optimize MemoryStream allocation (@snakefoot) - [#2456](https://github.com/nlog/nlog/pull/2456) FileTarget: Support byte order mark (optional) (#2456) (@KYegres) @@ -612,7 +1509,7 @@ Changes since rc 07: - [#2458](https://github.com/nlog/nlog/pull/2458) Document and (minor) refactor on MruCache class (@ie-zero) - [#2452](https://github.com/nlog/nlog/pull/2452) ThreadLocalStorageHelper - NetStandard only allocate when needed (@snakefoot) -### v4.5-rc02 (2017/12/04) +### Version 4.5-rc02 (2017/12/04) - [#2444](https://github.com/nlog/nlog/pull/2444) NLog 4.5 RC2 version and changelog (@304NotModified) - [#2450](https://github.com/nlog/nlog/pull/2450) No need to call type(T) (@304NotModified) - [#2451](https://github.com/nlog/nlog/pull/2451) FileTarget - Improved and less internal logging (@snakefoot) @@ -630,7 +1527,7 @@ Changes since rc 07: - [#2417](https://github.com/nlog/nlog/pull/2417) IsMono - Cache Type.GetType to avoid constant AppDomain.TypeResolve events (@snakefoot) - [#2420](https://github.com/nlog/nlog/pull/2420) Merged CallSite Test from PR1812 (@snakefoot) -### v4.5-rc01 (2017/11/23) +### Version 4.5-rc01 (2017/11/23) - [#2414](https://github.com/nlog/nlog/pull/2414) Revert breaking change of NestedDiagnosticsLogicalContext.Pop() (@304NotModified) - [#2415](https://github.com/nlog/nlog/pull/2415) NetStandard15 - Moved dependency System.Xml.XmlSerializer to NLog.Wcf (@snakefoot) - [#2413](https://github.com/nlog/nlog/pull/2413) NestedDiagnosticsLogicalContext - Protect against double dispose (@snakefoot) @@ -663,7 +1560,7 @@ Changes since rc 07: - [#2362](https://github.com/nlog/nlog/pull/2362) NLog - NETSTANDARD1_5 (Cleanup package references) (@snakefoot) - [#2361](https://github.com/nlog/nlog/pull/2361) Use expression-bodied members (@c0shea) -### v4.5-beta07 (2017/10/15) +### Version 4.5-beta07 (2017/10/15) - [#2359](https://github.com/nlog/nlog/pull/2359) WrapperLayoutRendererBase - Transform with access to LogEventInfo (@snakefoot) - [#2357](https://github.com/nlog/nlog/pull/2357) ExceptionLayoutRenderer - Support Serialize Format (@snakefoot) - [#2358](https://github.com/nlog/nlog/pull/2358) WrapperLayoutRendererBuilderBase - Transform with access to LogEventInfo (@snakefoot) @@ -675,16 +1572,16 @@ Changes since rc 07: - [#2349](https://github.com/nlog/nlog/pull/2349) NLog - NETSTANDARD1_5 (Fix uppercase with culture) (@snakefoot) - [#2341](https://github.com/nlog/nlog/pull/2341) NLog - NETSTANDARD1_5 (@snakefoot) -### v4.5-beta06 (2017/10/12) +### Version 4.5-beta06 (2017/10/12) - [#2346](https://github.com/nlog/nlog/pull/2346) Add messageTemplateParser to XSD (@304NotModified) - [#2348](https://github.com/nlog/nlog/pull/2348) NLog MessageTemplateParameter with CaptureType (@snakefoot) -### v4.5-beta05 (2017/10/12) +### Version 4.5-beta05 (2017/10/12) - [#2340](https://github.com/nlog/nlog/pull/2340) NLog - MessageTemplateParameters - Always parse when IsPositional (@304NotModified, @snakefoot) - [#2337](https://github.com/nlog/nlog/pull/2337) Use string interpolation (@c0shea) - [#2327](https://github.com/nlog/nlog/pull/2327) Naming: consistent private fields (@304NotModified) -### v4.5-beta04 (2017/10/10) +### Version 4.5-beta04 (2017/10/10) - [#2318](https://github.com/nlog/nlog/pull/2318) NLog 4.5 beta 4 (@304NotModified) - [#2326](https://github.com/nlog/nlog/pull/2326) NLog - ValueSerializer - Faster integer and enum (@snakefoot) - [#2328](https://github.com/nlog/nlog/pull/2328) fix xunit warning (@304NotModified) @@ -706,119 +1603,119 @@ Changes since rc 07: - [#2262](https://github.com/nlog/nlog/pull/2262) LogEventInfo.MessageTemplate - Subset of LogEventInfo.Properties (@snakefoot) - [#2300](https://github.com/nlog/nlog/pull/2300) Fixed title (@304NotModified) -### v4.5-beta03 (2017/09/30) +### Version 4.5-beta03 (2017/09/30) - [#2298](https://github.com/nlog/nlog/pull/2298) Search also for lowercase nlog.config (@304NotModified) - [#2297](https://github.com/nlog/nlog/pull/2297) WhenRepeatedFilter - Log after timeout (@snakefoot) -### v4.5-beta01 (2017/09/16) +### Version 4.5-beta01 (2017/09/16) - [#2263](https://github.com/nlog/nlog/pull/2263) Support .NET Standard 2.0 and move to VS 2017 (@snakefoot) -### v4.4.13 (2018/02/28) +### Version 4.4.13 (2018/02/28) -#### Fixes +**Fixes** - [#2600](https://github.com/nlog/nlog/pull/2600) Fix 'System.ReadOnlySpan`1[System.Char]' cannot be converted to type 'System.String' (@snakefoot) -### v4.4.12 (2017/08/08) +### Version 4.4.12 (2017/08/08) -#### Fixes +**Fixes** - [#2229](https://github.com/nlog/nlog/pull/2229) Fix: ReconfigExistingLoggers sometimes throws an Exception (@jpdillingham) -### v4.4.11 (2017/06/17) +### Version 4.4.11 (2017/06/17) -#### Fixes +**Fixes** - [#2164](https://github.com/nlog/nlog/pull/2164) JsonLayout - Don't mark ThreadAgnostic when IncludeMdc or IncludeMdlc is enabled (@snakefoot) -### v4.4.10 (2017/05/31) +### Version 4.4.10 (2017/05/31) -#### Features +**Features** - [#2110](https://github.com/nlog/nlog/pull/2110) NdlcLayoutRenderer - Nested Diagnostics Logical Context (@snakefoot) - [#2114](https://github.com/nlog/nlog/pull/2114) EventlogTarget: Support for MaximumKilobytes (@304NotModified, @ajitpeter) - [#2109](https://github.com/nlog/nlog/pull/2109) JsonLayout - IncludeMdc and IncludeMdlc (@snakefoot) -#### Fixes +**Fixes** - [#2138](https://github.com/nlog/nlog/pull/2138) ReloadConfigOnTimer - fix potential NullReferenceException (@snakefoot) - [#2113](https://github.com/nlog/nlog/pull/2113) BugFix: `` after `` won't work (@304NotModified, @Moafak) - [#2131](https://github.com/nlog/nlog/pull/2131) Fix : LogManager.ReconfigureExistingLoggers() could throw InvalidOperationException (@304NotModified, @jpdillingham) -#### Improvements +**Improvements** - [#2137](https://github.com/nlog/nlog/pull/2137) NLogTraceListener - Reduce overhead by checking LogLevel (@snakefoot) - [#2112](https://github.com/nlog/nlog/pull/2112) LogReceiverWebServiceTarget - Ensure PrecalculateVolatileLayouts (@snakefoot) - [#2103](https://github.com/nlog/nlog/pull/2103) Improve Install of targets / crash Install on Databasetarget. (@M4ttsson) - [#2101](https://github.com/nlog/nlog/pull/2101) LogFactory.Shutdown - Add warning on target flush timeout (@snakefoot) -### v4.4.9 +### Version 4.4.9 -#### Features +**Features** - [#2090](https://github.com/nlog/nlog/pull/2090) ${log4jxmlevent} - Added IncludeAllProperties option (@snakefoot) - [#2090](https://github.com/nlog/nlog/pull/2090) Log4JXmlEvent Layout - Added IncludeAllProperties, IncludeMdlc and IncludeMdc option (@snakefoot) -#### Fixes +**Fixes** - [#2090](https://github.com/nlog/nlog/pull/2090) Log4JXmlEvent Layout - Fixed bug with empty nlog:properties (@snakefoot) - [#2093](https://github.com/nlog/nlog/pull/2093) Fixed bug to logging by day of week (@RussianDragon) - [#2095](https://github.com/nlog/nlog/pull/2095) Fix: include ignoreErrors attribute not working for non-existent file (@304NotModified, @ghills) -### v4.4.8 (2017/04/28) +### Version 4.4.8 (2017/04/28) -#### Features +**Features** - [#2078](https://github.com/nlog/nlog/pull/2078) Include MDLC in log4j renderer (option) (@thoemmi) -### v4.4.7 (2017/04/25) +### Version 4.4.7 (2017/04/25) -#### Features +**Features** - [#2063](https://github.com/nlog/nlog/pull/2063) JsonLayout - Added JsonAttribute property EscapeUnicode (@snakefoot) -#### Improvements +**Improvements** - [#2075](https://github.com/nlog/nlog/pull/2075) StackTraceLayoutRenderer with Raw format should display source FileName (@snakefoot) - [#2067](https://github.com/nlog/nlog/pull/2067) ${EventProperties}, ${newline}, ${basedir} & ${tempdir} as ThreadAgnostic (performance improvement) (@snakefoot) - [#2061](https://github.com/nlog/nlog/pull/2061) MethodCallTarget - Fixed possible null-reference-exception on initialize (@snakefoot) -## v4.4.6 (2017/04/11) +## Version 4.4.6 (2017/04/11) -#### Features +**Features** - [#2006](https://github.com/nlog/nlog/pull/2006) Added AsyncTaskTarget - Base class for using async methods (@snakefoot) - [#2051](https://github.com/nlog/nlog/pull/2051) Added LogMessageGenerator overloads for exceptions (#2051) (@c0shea) - [#2034](https://github.com/nlog/nlog/pull/2034) ${level} add format option (full, single char and ordinal) (#2034) (@c0shea) - [#2042](https://github.com/nlog/nlog/pull/2042) AutoFlushTargetWrapper - Added AsyncFlush property (@snakefoot) -#### Improvements +**Improvements** - [#2048](https://github.com/nlog/nlog/pull/2048) Layout - Ensure StackTraceUsage works for all types of Layout (@snakefoot) - [#2041](https://github.com/nlog/nlog/pull/2041) Reduce memory allocations (AsyncContinuation exceptionHandler) & refactor (@snakefoot) - [#2040](https://github.com/nlog/nlog/pull/2040) WebServiceTarget - Avoid re-throwing exceptions in async completion method (@snakefoot) -### v4.4.5 (2017/03/28) +### Version 4.4.5 (2017/03/28) -#### Fixes +**Fixes** - [#2010](https://github.com/nlog/nlog/pull/2010) LogFactory - Ensure to flush and close on shutdown - fixes broken logging (@snakefoot) - [#2017](https://github.com/nlog/nlog/pull/2017) WebServiceTarget - Fix boolean parameter conversion for Xml and Json (lowercase) (@snakefoot) -#### Improvements +**Improvements** - [#2017](https://github.com/nlog/nlog/pull/2017) Merged the JSON serializer code into DefaultJsonSerializer (@snakefoot) -### 4.4.4 (2017/03/10) +### Version 4.4.4 (2017/03/10) -#### Features +**Features** - [#2000](https://github.com/nlog/nlog/pull/2000) Add weekly archival option to FileTarget (@dougthor42) - [#2009](https://github.com/nlog/nlog/pull/2009) Load assembly event (@304NotModified) - [#1917](https://github.com/nlog/nlog/pull/1917) Call NLogPackageLoader.Preload (static) for NLog packages on load (@304NotModified) -#### Improvements +**Improvements** - [#2007](https://github.com/nlog/nlog/pull/2007) Target.Close() - Extra logging to investigate shutdown order (@snakefoot) - [#2003](https://github.com/nlog/nlog/pull/2003) Update XSD for `` options (@304NotModified) @@ -826,20 +1723,20 @@ Changes since rc 07: - [#1956](https://github.com/nlog/nlog/pull/1956) Improve docs ThreadAgnosticAttribute (#1956) (@304NotModified) - [#1992](https://github.com/nlog/nlog/pull/1992) Fixed merge error of XML documentation for Target Write-methods (@snakefoot) -#### Fixes +**Fixes** - [#1995](https://github.com/nlog/nlog/pull/1995) Proper apply default-target-parameters to nested targets in WrappedTargets (@nazim9214) -### 4.4.3 (2017/02/17) +### Version 4.4.3 (2017/02/17) -#### Fixes +**Fixes** - [#1966](https://github.com/nlog/nlog/pull/1966) System.UriFormatException on load (Mono) (@JustArchi) - [#1960](https://github.com/nlog/nlog/pull/1960) EventLogTarget: Properly parse and set EventLog category (@marinsky) -### 4.4.2 (2017/02/06) +### Version 4.4.2 (2017/02/06) -#### Features +**Features** - [#1799](https://github.com/nlog/nlog/pull/1799) FileTarget: performance improvement: 10-70% faster, less garbage collecting (3-4 times less) by reusing buffers (@snakefoot, @AndreGleichner) - [#1919](https://github.com/nlog/nlog/pull/1919) Func overloads for InternalLogger (@304NotModified) @@ -847,7 +1744,7 @@ Changes since rc 07: - [#1914](https://github.com/nlog/nlog/pull/1914) basedir: added option processDir=true (@304NotModified) - [#1906](https://github.com/nlog/nlog/pull/1906) Allow Injecting basedir (@304NotModified) -#### Improvements +**Improvements** - [#1927](https://github.com/nlog/nlog/pull/1927) InternalLogger - Better support for multiple threads when using file (@snakefoot) - [#1871](https://github.com/nlog/nlog/pull/1871) Filetarget - Allocations optimization (#1871) (@nazim9214) @@ -865,13 +1762,13 @@ Changes since rc 07: - [#1899](https://github.com/nlog/nlog/pull/1899) LogManager.Shutdown - Use the official method for closing down (@snakefoot) -#### Fixes +**Fixes** - [#1886](https://github.com/nlog/nlog/pull/1886) FileTarget - Archive should not fail when ArchiveFileName matches FileName (@snakefoot) - [#1893](https://github.com/nlog/nlog/pull/1893) FileTarget - MONO doesn't like using the native Win32 API (@snakefoot) - [#1883](https://github.com/nlog/nlog/pull/1883) LogFactory.Dispose - Should always close down created targets (@snakefoot) -### v4.4.1 (2016/12/24) +### Version 4.4.1 (2016/12/24) Summary: @@ -903,9 +1800,9 @@ Detail: - [#1844](https://github.com/nlog/nlog/pull/1844) FileTarget - Mono2 runtime detection to skip using named archive-mutex (@snakefoot) -### v4.4 (2016/12/14) +### Version 4.4 (2016/12/14) -#### Features +**Features** - [#1583](https://github.com/nlog/nlog/pull/1583) Don't stop logging when there is an invalid layoutrenderer in the layout. (@304NotModified) - [#1740](https://github.com/nlog/nlog/pull/1740) WebServiceTarget support for JSON & Injecting JSON serializer into NLog (#1740) (@tetrodoxin) @@ -921,7 +1818,7 @@ Detail: - [#1836](https://github.com/nlog/nlog/pull/1836) Callsite: add includeNamespace option (@304NotModified) - [#1817](https://github.com/nlog/nlog/pull/1817) Added condition to AutoFlushWrappper (@nazim9214) -#### Improvements +**Improvements** - [#1732](https://github.com/nlog/nlog/pull/1732) Handle duplicate attributes (error or using first occurence) in nlog.config (@nazim9214) - [#1778](https://github.com/nlog/nlog/pull/1778) ConsoleTarget - DetectConsoleAvailable - Disabled by default (@snakefoot) @@ -935,9 +1832,9 @@ Detail: - [#1755](https://github.com/nlog/nlog/pull/1755) General performance improvement (@snakefoot) - [#1756](https://github.com/nlog/nlog/pull/1755) WindowsMultiProcessFileAppender (@snakefoot, @AndreGleichner) -### v4.3.11 (2016/11/07) +### Version 4.3.11 (2016/11/07) -#### Improvements +**Improvements** - [#1700](https://github.com/nlog/nlog/pull/1700) Improved concurrency when multiple Logger threads are writing to async Target (@snakefoot) - [#1750](https://github.com/nlog/nlog/pull/1750) Log payload for NLogViewerTarget/NetworkTarget to Internal Logger (@304NotModified) @@ -949,7 +1846,7 @@ Detail: - [#1814](https://github.com/nlog/nlog/pull/1814) Improve [Obsolete] warnings - include the Nlog version when it became obsolete (#1814) (@ie-zero) - [#1809](https://github.com/nlog/nlog/pull/1809) FileTarget - Close stale file handles outside archive mutex lock (@snakefoot) -#### Fixes +**Fixes** - [#1749](https://github.com/nlog/nlog/pull/1749) Try-catch for permission when autoloading - fixing Android permission issue (@304NotModified) - [#1751](https://github.com/nlog/nlog/pull/1751) ExceptionLayoutRenderer: prevent nullrefexception when exception is null (@304NotModified) @@ -957,15 +1854,15 @@ Detail: -### v4.3.10 (2016/10/11) +### Version 4.3.10 (2016/10/11) -#### Features +**Features** - [#1680](https://github.com/nlog/nlog/pull/1680) Append to existing archive file (@304NotModified) - [#1669](https://github.com/nlog/nlog/pull/1669) AsyncTargetWrapper - Allow TimeToSleepBetweenBatches = 0 (@snakefoot) - [#1668](https://github.com/nlog/nlog/pull/1668) Console Target Automatic Detect if console is available (@snakefoot) -#### Improvements +**Improvements** - [#1697](https://github.com/nlog/nlog/pull/1697) Archiving should never fail writing (@304NotModified) - [#1695](https://github.com/nlog/nlog/pull/1695) Performance: Counter/ProcessId/ThreadId-LayoutRenderer allocations less memory (@snakefoot) @@ -976,105 +1873,105 @@ Detail: - [#1702](https://github.com/nlog/nlog/pull/1702) Performance: InternalLogger should only allocate params-array when needed (@snakefoot) -#### Fixes +**Fixes** - [#1676](https://github.com/nlog/nlog/pull/1676) Fix FileTarget on Xamarin: Remove mutex usage for Xamarin 'cause of runtime exceptions (@304NotModified) - [#1591](https://github.com/nlog/nlog/pull/1591) Count operation on AsyncRequestQueue is not thread-safe (@snakefoot) -### v4.3.9 (2016/09/18) +### Version 4.3.9 (2016/09/18) -#### Features +**Features** - [#1641](https://github.com/nlog/nlog/pull/1641) FileTarget: Add WriteFooterOnArchivingOnly parameter. (@bhaeussermann) - [#1628](https://github.com/nlog/nlog/pull/1628) Add ExceptionDataSeparator option for ${exception} (@FroggieFrog) - [#1626](https://github.com/nlog/nlog/pull/1626) cachekey option for cache layout wrapper (@304NotModified) -#### Improvements +**Improvements** - [#1643](https://github.com/nlog/nlog/pull/1643) Pause logging when the race condition occurs in (Colored)Console Target (@304NotModified) - [#1632](https://github.com/nlog/nlog/pull/1632) Prevent possible crash when archiving in folder with non-archived files (@304NotModified) -#### Fixes +**Fixes** - [#1646](https://github.com/nlog/nlog/pull/1646) FileTarget: Fix file archive race-condition. (@bhaeussermann) - [#1642](https://github.com/nlog/nlog/pull/1642) MDLC: fixing mutable dictionary issue (improvement) (@vlardn) - [#1635](https://github.com/nlog/nlog/pull/1635) Fix ${tempdir} and ${nlogdir} if both have dir and file. (@304NotModified) -### v4.3.8 (2016/09/05) +### Version 4.3.8 (2016/09/05) -#### Features +**Features** - [#1619](https://github.com/NLog/NLog/pull/1619) NetworkTarget: Added option to specify EOL (@kevindaub) -#### Improvements +**Improvements** - [#1596](https://github.com/NLog/NLog/pull/1596) Performance tweak in NLog routing (@304NotModified) - [#1593](https://github.com/NLog/NLog/pull/1593) FileTarget: large performance improvement - back to 1 million/sec (@304NotModified) - [#1621](https://github.com/nlog/nlog/pull/1621) FileTarget: writing to non-existing drive was slowing down NLog a lot (@304NotModified) -#### Fixes +**Fixes** - [#1616](https://github.com/nlog/nlog/pull/1616) FileTarget: Don't throw an exception if a dir is missing when deleting old files on startup (@304NotModified) -### v4.3.7 (2016/08/06) +### Version 4.3.7 (2016/08/06) -#### Features +**Features** - [#1469](https://github.com/nlog/nlog/pull/1469) Allow overwriting possible nlog configuration file paths (@304NotModified) - [#1578](https://github.com/nlog/nlog/pull/1578) Add support for name parameter on ${Assembly-version} (@304NotModified) - [#1580](https://github.com/nlog/nlog/pull/1580) Added option to not render empty literals on nested json objects (@johnkors) -#### Improvements +**Improvements** - [#1558](https://github.com/nlog/nlog/pull/1558) Callsite layout renderer: improve string comparison test (performance) (@304NotModified) - [#1582](https://github.com/nlog/nlog/pull/1582) FileTarget: Performance improvement for CleanupInvalidFileNameChars (@304NotModified) -#### Fixes +**Fixes** - [#1556](https://github.com/nlog/nlog/pull/1556) Bugfix: Use the culture when rendering the layout (@304NotModified) -### v4.3.6 (2016/07/24) +### Version 4.3.6 (2016/07/24) -#### Features +**Features** - [#1531](https://github.com/nlog/nlog/pull/1531) Support Android 4.4 (@304NotModified) - [#1551](https://github.com/nlog/nlog/pull/1551) Addded CompoundLayout (@luigiberrettini) -#### Fixes +**Fixes** - [#1548](https://github.com/nlog/nlog/pull/1548) Bugfix: Can't update EventLog's Source property (@304NotModified, @Page-Not-Found) - [#1553](https://github.com/nlog/nlog/pull/1553) Bugfix: Throw configException when registering invalid extension assembly/type. (@304NotModified, @Jeinhaus) - [#1547](https://github.com/nlog/nlog/pull/1547) LogReceiverWebServiceTarget is leaking communication channels (@MartinTherriault) -### v4.3.5 (2016/06/13) +### Version 4.3.5 (2016/06/13) -#### Features +**Features** - [#1471](https://github.com/nlog/nlog/pull/1471) Add else option to ${when} (@304NotModified) - [#1481](https://github.com/nlog/nlog/pull/1481) get items for diagnostic contexts (DiagnosticsContextes, GetNames() method) (@tiljanssen) -#### Fixes +**Fixes** - [#1504](https://github.com/nlog/nlog/pull/1504) Fix ${callsite} with async method with return value (@PELNZ) -### v4.3.4 (2016/05/16) +### Version 4.3.4 (2016/05/16) -#### Features +**Features** - [#1423](https://github.com/nlog/nlog/pull/1423) Injection of zip-compressor for fileTarget (@AndreGleichner) - [#1434](https://github.com/nlog/nlog/pull/1434) Added constructors with name argument to the target types (@304NotModified, @flyingcroissant) - [#1400](https://github.com/nlog/nlog/pull/1400) Added WrapLineLayoutRendererWrapper (@mathieubrun) -#### Improvements +**Improvements** - [#1456](https://github.com/nlog/nlog/pull/1456) FileTarget: Improvements in FileTarget archive cleanup. (@bhaeussermann) - [#1417](https://github.com/nlog/nlog/pull/1417) FileTarget prevent stackoverflow after setting FileName property on init (@304NotModified) -#### Fixes +**Fixes** - [#1454](https://github.com/nlog/nlog/pull/1454) Fix LoggingRule.ToString (@304NotModified) - [#1453](https://github.com/nlog/nlog/pull/1453) Fix potential nullref exception in LogManager.Shutdown() (@304NotModified) - [#1450](https://github.com/nlog/nlog/pull/1450) Fix duplicate Target after config Initialize (@304NotModified) - [#1446](https://github.com/nlog/nlog/pull/1446) FileTarget: create dir if CreateDirs=true and replacing file content (@304NotModified) - [#1432](https://github.com/nlog/nlog/pull/1432) Check if directory NLog.dll is detected in actually exists (@gregmac) -#### Other +**Other** - [#1440](https://github.com/nlog/nlog/pull/1440) Added extra unit tests for context classes (@304NotModified) -### v4.3.3 (2016/04/28) +### Version 4.3.3 (2016/04/28) - [#1411](https://github.com/nlog/nlog/pull/1411) MailTarget: fix "From" errors (bug introduced in NLog 4.3.2) (@304NotModified) -### v4.3.2 (2016/04/26) +### Version 4.3.2 (2016/04/26) - [#1404](https://github.com/nlog/nlog/pull/1404) FileTarget cleanup: move to background thread. (@304NotModified) - [#1403](https://github.com/nlog/nlog/pull/1403) Fix filetarget: Thread was being aborted (#2) (@304NotModified) - [#1402](https://github.com/nlog/nlog/pull/1402) Getting the 'From' when UseSystemNetMailSettings is true (@MoaidHathot) @@ -1083,29 +1980,29 @@ Detail: - [#1394](https://github.com/nlog/nlog/pull/1394) Make test methods public (#1394) (@luigiberrettini) - [#1393](https://github.com/nlog/nlog/pull/1393) Remove test dependency on locale (@luigiberrettini) -### v4.3.1 (2016/04/20) +### Version 4.3.1 (2016/04/20) - [#1386](https://github.com/nlog/nlog/pull/1386) Fix "allLayouts is null" exception (@304NotModified) - [#1387](https://github.com/nlog/nlog/pull/1387) Fix filetarget: Thread was being aborted (@304NotModified) - [#1383](https://github.com/nlog/nlog/pull/1383) Fix configuration usage in `${var}` renderer (@bhaeussermann, @304NotModified) -### v4.3.0 (2016/04/16) +### Version 4.3.0 (2016/04/16) - [#1211](https://github.com/nlog/nlog/pull/1211) Update nlog.config for 4.3 (@304NotModified) - [#1368](https://github.com/nlog/nlog/pull/1368) Update license (@304NotModified) -### v4.3.0-rc3 (2016/04/09) +### Version 4.3.0-rc3 (2016/04/09) - [#1348](https://github.com/nlog/nlog/pull/1348) Fix nullref + fix relative path for file archive (@304NotModified) - [#1352](https://github.com/nlog/nlog/pull/1352) Fix for writing log file to root path (@304NotModified) - [#1357](https://github.com/nlog/nlog/pull/1357) autoload NLog.config in assets folder (Xamarin Android) (@304NotModified) - [#1358](https://github.com/nlog/nlog/pull/1358) no-recusive logging in internallogger. (@304NotModified) - [#1364](https://github.com/nlog/nlog/pull/1364) Fix stacktraceusage with more than 1 rule (@304NotModified) -### v4.3.0-rc2 (2016/03/26) +### Version 4.3.0-rc2 (2016/03/26) - [#1335](https://github.com/nlog/nlog/pull/1335) Fix all build warnings (@304NotModified) - [#1336](https://github.com/nlog/nlog/pull/1336) Throw NLogConfigurationException if TimeToSleepBetweenBatches `<= 0` (@vincechan) - [#1333](https://github.com/nlog/nlog/pull/1333) Fix ${callsite} when loggerType can't be found due to inlining (@304NotModified) - [#1329](https://github.com/nlog/nlog/pull/1329) Update SHFB (@304NotModified) -### v4.3.0-rc1 (2016/03/22) +### Version 4.3.0-rc1 (2016/03/22) - [#1323](https://github.com/nlog/nlog/pull/1323) Add TimeStamp options to XML, Appsetting and environment var (@304NotModified) - [#1286](https://github.com/nlog/nlog/pull/1286) Easier api: AddRule methods, fix AllTargets crash, fix IsLevelEnabled(off) crash, refactor internal (@304NotModified) - [#1317](https://github.com/nlog/nlog/pull/1317) don't require ProviderName attribute when using `` (app.config etc) (@304NotModified) @@ -1150,7 +2047,7 @@ Detail: - [#1232](https://github.com/nlog/nlog/pull/1232) Fix HttpGet protocol for WebService (@MikeFH) - [#1223](https://github.com/nlog/nlog/pull/1223) Fix deadlock on Factory (@304NotModified) -### v4.3.0-beta2 (2016/02/04) +### Version 4.3.0-beta2 (2016/02/04) - [#1220](https://github.com/nlog/nlog/pull/1220) FileTarget: Add internal logging for archive date. (@bhaeussermann) - [#1214](https://github.com/nlog/nlog/pull/1214) Better unit test cleanup between tests + fix threadsafe issue ScanProperties (@304NotModified) - [#1212](https://github.com/nlog/nlog/pull/1212) Support reading nlog.config from Android assets folder (@304NotModified) @@ -1163,7 +2060,7 @@ Detail: - [#1197](https://github.com/nlog/nlog/pull/1197) Improve XML Docs (@304NotModified) - [#1200](https://github.com/nlog/nlog/pull/1200) Added unit test for K datetime format (@304NotModified) -### 4.3.0-beta1 (2016/01/27) +### Version 4.3.0-beta1 (2016/01/27) - [#1143](https://github.com/nlog/nlog/pull/1143) Consistent Exception handling v3 (@304NotModified) - [#1195](https://github.com/nlog/nlog/pull/1195) FileTarget: added ReplaceFileContentsOnEachWriteTest (@304NotModified) - [#925](https://github.com/nlog/nlog/pull/925) RegistryLayoutRenderer: Support for layouts, RegistryView (32, 64 bit) and all root key names (HKCU/HKLM etc) (@304NotModified, @Niklas-Peter) @@ -1200,7 +2097,7 @@ Detail: - [#1099](https://github.com/nlog/nlog/pull/1099) Added extra callsite unit tests (@304NotModified) - [#1084](https://github.com/nlog/nlog/pull/1084) Log unused targets to internal logger (@UgurAldanmaz) -### 4.2.3 (2015/12/12) +### Version 4.2.3 (2015/12/12) - [#1083](https://github.com/nlog/nlog/pull/1083) Changed the heading in Readme file (@Page-Not-Found) - [#1081](https://github.com/nlog/nlog/pull/1081) Update README.md (@UgurAldanmaz) - [#4](https://github.com/nlog/nlog/pull/4) Update from base repository (@304NotModified, @bhaeussermann, @ie-zero, @epignosisx, @stefandevo, @nathan-schubkegel) @@ -1210,12 +2107,12 @@ Detail: - [#1040](https://github.com/nlog/nlog/pull/1040) Xamarin (iOS, Android) and Windows Phone 8 (@304NotModified, @stefandevo) - [#1041](https://github.com/nlog/nlog/pull/1041) EventLogTarget: Add overflow action for too large messages (@epignosisx) -### 4.2.2 (2015/11/21) +### Version 4.2.2 (2015/11/21) - [#1054](https://github.com/nlog/nlog/pull/1054) LogReceiverWebServiceTarget.CreateLogReceiver() should be virtual (@304NotModified) - [#1048](https://github.com/nlog/nlog/pull/1048) Var layout renderer improvements (@304NotModified) - [#1043](https://github.com/nlog/nlog/pull/1043) Moved sourcecode tests to separate tool (@304NotModified) -### 4.2.1-RC1 (2015/11/13) +### Version 4.2.1-RC1 (2015/11/13) - [#1031](https://github.com/nlog/nlog/pull/1031) NetworkTarget: linkedlist + configure max connections (@304NotModified) - [#1037](https://github.com/nlog/nlog/pull/1037) Added FilterResult tests (@304NotModified) - [#1036](https://github.com/nlog/nlog/pull/1036) Logbuilder tests + fix passing Off (@304NotModified) @@ -1232,7 +2129,7 @@ Detail: - [#1000](https://github.com/nlog/nlog/pull/1000) Fix methods' indentation in LogManager class (@ie-zero) - [#1001](https://github.com/nlog/nlog/pull/1001) Dump() now uses InternalLogger.Debug() consistent (@ie-zero) -### 4.2.0 (2015/10/24) +### Version 4.2.0 (2015/10/24) - [#996](https://github.com/nlog/nlog/pull/996) ColoredConsoleTarget: Fixed broken WholeWords option of highlight-word. (@bhaeussermann) - [#995](https://github.com/nlog/nlog/pull/995) ArchiveFileCompression: auto add `.zip` to compressed filename when archiveName isn't specified (@bhaeussermann) - [#993](https://github.com/nlog/nlog/pull/993) changed to nuget appveyor account (@304NotModified) @@ -1269,14 +2166,14 @@ Detail: - [#927](https://github.com/nlog/nlog/pull/927) Comments change in LogFactory (@Niklas-Peter) - [#926](https://github.com/nlog/nlog/pull/926) Assure automatic re-configuration after configuration change (@Niklas-Peter) -### 4.1.2 (2015/09/20) +### Version 4.1.2 (2015/09/20) - [#920](https://github.com/nlog/nlog/pull/920) Added AssemblyFileVersion as property to build script (@304NotModified) - [#912](https://github.com/nlog/nlog/pull/912) added fluent .properties, fix/add fluent unit tests (@304NotModified) - [#909](https://github.com/nlog/nlog/pull/909) added ThreadAgnostic on AllEventPropertiesLayoutRenderer (@304NotModified) - [#910](https://github.com/nlog/nlog/pull/910) Fixes "Collection was modified" crash with ReconfigExistingLoggers (@304NotModified) - [#906](https://github.com/nlog/nlog/pull/906) added some extra tests (@304NotModified) -### 4.1.1 (2015/09/12) +### Version 4.1.1 (2015/09/12) - [#900](https://github.com/nlog/nlog/pull/900) fix generated code after change .tt (#894) (@304NotModified) - [#901](https://github.com/nlog/nlog/pull/901) Safe autoload (@304NotModified) - [#894](https://github.com/nlog/nlog/pull/894) fix generated code after change .tt (#894) (@304NotModified) @@ -1286,7 +2183,7 @@ Detail: - [#892](https://github.com/nlog/nlog/pull/892) Remove unused windows.forms stuff (@304NotModified) - [#894](https://github.com/nlog/nlog/pull/894) Obsolete attribute doesn't specify the correct replacement (@vbfox) -### 4.1.0 (2015/08/30) +### Version 4.1.0 (2015/08/30) - [#884](https://github.com/nlog/nlog/pull/884) Changes at MDLC to support .Net 4.0 and .Net 4.5 (@UgurAldanmaz) - [#881](https://github.com/nlog/nlog/pull/881) Change GitHub for Windows to GitHub Desktop (@campbeb) - [#874](https://github.com/nlog/nlog/pull/874) Wcf receiver client (@kevindaub, @304NotModified) @@ -1330,7 +2227,7 @@ Detail: - [#794](https://github.com/nlog/nlog/pull/794) Support for auto loading UNC paths (@mikeobrien) - [#786](https://github.com/nlog/nlog/pull/786) added unit test for forwardscomp (@304NotModified) -### 4.0.1 (2015/06/18) +### Version 4.0.1 (2015/06/18) - [#762](https://github.com/nlog/nlog/pull/762) Improved config example (@304NotModified) - [#760](https://github.com/nlog/nlog/pull/760) Autoload fix for ASP.net + better autoloading logging (@304NotModified) - [#763](https://github.com/nlog/nlog/pull/763) Fixed reference for Siverlight (broken and fixed in 4.0.1) (@304NotModified) @@ -1346,10 +2243,10 @@ Detail: - [#736](https://github.com/nlog/nlog/pull/736) fixes issue (#736) when the NLog assembly is loaded from memory (@akamyshanov) - [#715](https://github.com/nlog/nlog/pull/715) Message queue target test check if queue exists (@304NotModified) -### 4.0.0 (2015/05/26) +### Version 4.0.0 (2015/05/26) - [#583](https://github.com/nlog/nlog/pull/583) .gitattributes specifies which files should be considered as text (@ilya-g) -### 4.0-RC (2015/05/26) +### Version 4.0-RC (2015/05/26) - [#717](https://github.com/nlog/nlog/pull/717) Improved description and warning. (@304NotModified) - [#718](https://github.com/nlog/nlog/pull/718) GOTO considered harmful (@304NotModified) - [#689](https://github.com/nlog/nlog/pull/689) Make alignment stay consistent when fixed-length truncation occurs.(AlignmentOnTruncation property) (@logiclrd) @@ -1375,7 +2272,7 @@ Detail: - [#651](https://github.com/nlog/nlog/pull/651) init `TimeStamp` and `SequenceID` in all ctors (@304NotModified) - [#657](https://github.com/nlog/nlog/pull/657) Fixed quite a few typos (@sean-gilliam) -### v3.2.1 (2015/03/26) +### Version 3.2.1 (2015/03/26) - [#600](https://github.com/nlog/nlog/pull/600) Looks good (@kichristensen) - [#645](https://github.com/nlog/nlog/pull/645) Stacktrace broken fix 321 (@304NotModified) - [#606](https://github.com/nlog/nlog/pull/606) LineEndingMode type in xml configuration and xsd schema (@ilya-g) @@ -1436,7 +2333,7 @@ Detail: - [#465](https://github.com/nlog/nlog/pull/465) Fix #283: throwExceptions ="false" but Is still an error (@YuLad) - [#464](https://github.com/nlog/nlog/pull/464) Added 'enabled' attribute to the logging rule element. (@ilya-g) -### v3.2.0.0 (2014/12/21) +### Version 3.2.0.0 (2014/12/21) - [#463](https://github.com/nlog/nlog/pull/463) Pluggable time sources support in NLog.xsd generator utility (@ilya-g) - [#460](https://github.com/nlog/nlog/pull/460) Add exception to NLogEvent (@kichristensen) - [#457](https://github.com/nlog/nlog/pull/457) Unobsolete XXXExceptions methods (@kichristensen) @@ -1466,7 +2363,7 @@ Detail: - [#377](https://github.com/nlog/nlog/pull/377) Apply small performance patch (@pgatilov) - [#382](https://github.com/nlog/nlog/pull/382) contribute fluent log builder (@pwelter34) -### v3.1.0 (2014/06/23) +### Version 3.1.0 (2014/06/23) - [#371](https://github.com/nlog/nlog/pull/371) Use merging of event properties in async target wrapper to fix empty collection issue (@tuukkapuranen) - [#357](https://github.com/nlog/nlog/pull/357) Extended ReplaceLayoutRendererWrapper and LayoutParser to support more advanced Regex replacements and more escape codes (@DannyVarod) - [#359](https://github.com/nlog/nlog/pull/359) Fix #71 : Removing invalid filename characters from created file (@cvanbergen) @@ -1478,7 +2375,7 @@ Detail: - [#352](https://github.com/nlog/nlog/pull/352) Remove public constructors from LogLevel (@ie-zero) - [#349](https://github.com/nlog/nlog/pull/349) Changed all ReSharper annotations to internal (issue 292) (@MichaelLogutov) -### v3.0 (2014/06/02) +### Version 3.0 (2014/06/02) - [#346](https://github.com/nlog/nlog/pull/346) Fix: #333 Delete archived files in correct order (@cvanbergen) - [#347](https://github.com/nlog/nlog/pull/347) Fixed #281: Don't create empty batches when event list is empty (@robertvazan) - [#246](https://github.com/nlog/nlog/pull/246) Additional Layout Renderer "Assembly-Name" (@Slowpython) @@ -1499,7 +2396,7 @@ Detail: - [#285](https://github.com/nlog/nlog/pull/285) Changed modifier of ProcessLogEventInfo (@cincuranet) - [#270](https://github.com/nlog/nlog/pull/270) Integrate JetBrains Annotations (@damageboy) -### 2.1.0 (2013/10/07) +### Version 2.1.0 (2013/10/07) - [#257](https://github.com/nlog/nlog/pull/257) Fixed SL5 compilation error (@emazv72) - [#241](https://github.com/nlog/nlog/pull/241) Date Based File Archiving (@mkaltner) - [#239](https://github.com/nlog/nlog/pull/239) Add layout renderer for retrieving values from AppSettings. (@mpareja) @@ -1510,7 +2407,7 @@ Detail: - [#215](https://github.com/nlog/nlog/pull/215) Revert "Fix writing NLog properties in Log4JXmlEvent" (@kichristensen) - [#206](https://github.com/nlog/nlog/pull/206) Correctly use comments in NLog.Config package (@kichristensen) -### v2.0.1 (2013/04/08) +### Version 2.0.1 (2013/04/08) - [#197](https://github.com/nlog/nlog/pull/197) Better request queue logging (@kichristensen) - [#192](https://github.com/nlog/nlog/pull/192) Allow Form Control Target to specify append direction (@simongh) - [#182](https://github.com/nlog/nlog/pull/182) Fix locks around layoutCache (@brutaldev) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..a2a223b06e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,125 @@ +Support & contributing guidelines +=== +Do you have feature requests, questions or would you like to report a bug? Please follow these guidelines when posting on the [issue list](https://github.com/NLog/NLog/issues). + +Feature requests +---- +Please provide the following information: +- The current NLog version +- Any current work-arounds +- Example of the config when implemented. Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). +- Pull requests and unit tests are welcome! + +Questions +---- +Please provide the following information: +- The current NLog version +- The current config (xml or code). Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). +- If relevant: the current result (Including full exception details if any) +- If relevant: the expected result + +Bug reports +---- +Please provide the following information: +- The current NLog version +- The error message and stacktrace. Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). +- The internal log, `Debug` level. See [Internal Logging](https://github.com/NLog/NLog/wiki/Internal-Logging) +- The current result +- The expected result +- Any current work-arounds +- The current config (xml or code). Please use [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/#fenced-code-blocks). +- Pull requests and unit tests are welcome! + + +Pull requests +---- +Unit tests are really appreciated! + +Please document any public method and property. Document **why** and not how. At least required: + +* Method: Summary, param and return. +* Property: Summary + + +Multiple .NET versions +---- +Keep in mind that multiple versions of .NET are supported. Some methods are not available in all .NET versions. The following conditional compilation symbols can be used: + +``` +#if NET35 +#if NETFRAMEWORK +#if NETSTANDARD2_1_OR_GREATER +``` + +.NET Framework is now the odd one, so focus should be on using `NETFRAMEWORK` to mark code that doesn't support NetStandard or NetCore. + +Contributing +---- +As the current NLog team is a small team, we cannot fix every bug or implement every feature on our own. So contributions are really appreciated! + +If you like to start with a small task, then +[up-for-grabs](https://github.com/NLog/NLog/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) are nice to start with. + +Please note, we have a `dev` and `master` branch + +- `master` is for pure bug fixes and targets NLog 5.x +- `dev` targets NLog 6 + + +A good way to get started (flow) + +1. Fork the NLog repos. +2. Create a new branch in you current repos from the 'dev' branch. (critical bugfixes from 'master') +3. 'Check out' the code with Git or [GitHub Desktop](https://desktop.github.com/) +4. Push commits and create a Pull Request (PR) to NLog + +Please note: bugfixes should target the **master** branch, others the **dev** branch (NLog 6) + +Update your fork +---- +Is your fork not up-to-date with the NLog code? Most of the time that isn't a problem. But if you like to "sync back" the changes to your repository, execute the following command: + +The first time: +``` +git remote add upstream https://github.com/NLog/NLog.git +``` + +After that you repository will have two remotes. You could update your remote (the fork) in the following way: +``` +git fetch upstream +git checkout +git rebase upstream/master +..fix if needed and +git push -f +``` + +if `rebase` won't work well, use `git merge master` as alternative. + +It's also possible to send a PR in the opposite direction, but that's not preferred as it will pollute the commit log. + + +How to build +---- +Use Visual Studio 2022 and open the solution 'NLog.sln'. + +For building in the cloud we use: +- AppVeyor for Windows- and Linux-builds +- SonarQube for code coverage + +Trying to build your fork in the cloud? Check [this how-to](howto-build-your-fork.md) + +Note: master points to NLog 5.x and dev to NLog 6 + +List of NLog extensions +=== +NLog Project Homepage provides a list of available [NLog Targets and Layouts](https://nlog-project.org/config/) + +To add a new NLog extension, then just create pull-request here: + +- https://github.com/NLog/NLog.github.io/pulls + +Updating the relevant file: + +- **NLog Targets** - https://github.com/NLog/NLog.github.io/blob/master/config/targets.json +- **NLog Layouts** - https://github.com/NLog/NLog.github.io/blob/master/config/layouts.json +- **NLog LayoutRenderers** - https://github.com/NLog/NLog.github.io/blob/master/config/layout-renderers.json diff --git a/LICENSE.txt b/LICENSE.txt index 7e2d2ae9d5..a156fdde84 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,31 +1,31 @@ -Copyright (c) 2004-2020 Jaroslaw Kowalski , Kim Christensen, Julian Verdurmen +Copyright (c) 2004-2024 Jaroslaw Kowalski , Kim Christensen, Julian Verdurmen All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. + and/or other materials provided with the distribution. -* Neither the name of Jaroslaw Kowalski nor the names of its +* Neither the name of Jaroslaw Kowalski nor the names of its contributors may be used to endorse or promote products derived from this - software without specific prior written permission. + software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README-developers.md b/README-developers.md index b8f0126187..64facd52fc 100644 --- a/README-developers.md +++ b/README-developers.md @@ -33,9 +33,9 @@ Build Pipeline For developing: the following platforms will be used: -- net45;net40-client;net35;netstandard1.3;netstandard1.5;netstandard2.0 (see nlog.csproj) +- net46;net45;net35;netstandard1.3;netstandard1.5;netstandard2.0 (see nlog.csproj) -For releasing, the following additional platfoms will be used: sl4;sl5;wp8;monoandroid44;xamarinios10 - see build.ps1 +The build server will run unit-tests on both Windows and Linux platforms (see build.ps1 + run-tests.ps1) NuGet package management === diff --git a/README.md b/README.md index 91b4a7a56c..a114423f05 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ ![NLog](https://raw.githubusercontent.com/NLog/NLog.github.io/master/images/NLog-logo-only_small.png) + [![NuGet](https://img.shields.io/nuget/v/nlog.svg)](https://www.nuget.org/packages/NLog) [![Semantic Versioning](https://img.shields.io/badge/semver-2.0.0-3D9FE0.svg)](https://semver.org/) -[![Twitter Follow](https://img.shields.io/twitter/follow/NLogOfficial.svg?style=social?maxAge=2592000)](https://twitter.com/NLogOfficial) - +[![NuGet downloads](https://img.shields.io/nuget/dt/NLog.svg)](https://www.nuget.org/packages/NLog) @@ -16,15 +16,6 @@ [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=nlog2&metric=coverage&branch=dev)](https://sonarcloud.io/dashboard?id=nlog2&branch=dev) - - - - - - [![](https://img.shields.io/badge/Docs-GitHub%20wiki-brightgreen)](https://github.com/NLog/NLog/wiki) [![](https://img.shields.io/badge/Troubleshoot-Guide-orange)](https://github.com/nlog/nlog/wiki/Logging-troubleshooting) @@ -33,48 +24,47 @@ NLog is a free logging platform for .NET with rich log routing and management capabilities. It makes it easy to produce and manage high-quality logs for your application regardless of its size or complexity. -It can process diagnostic messages emitted from any .NET language, augment -them with contextual information, format them according to your preference -and send them to one or more targets such as file or database. - -Major and minor releases will be posted on [project news](https://nlog-project.org/archives/). For smaller updates, follow us on [Twitter](https://twitter.com/NLogOfficial) +Handles both [structured logging](https://github.com/nlog/nlog/wiki/How-to-use-structured-logging) and traditional logging from any .NET language, +augment with contextual information, format according to your preference +and send them to one or more targets such as file or console. +Major and minor releases will be posted on [project news](https://nlog-project.org/archives/). Getting started --- * [.NET Framework](https://github.com/NLog/NLog/wiki/Tutorial) - * [ASP.NET Core](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-2) + * [ASP.NET Core](https://github.com/NLog/NLog/wiki/Getting-started-with-ASP.NET-Core-6) * [.NET Core Console](https://github.com/NLog/NLog/wiki/Getting-started-with-.NET-Core-2---Console-application) -For the possible options in the config, check the [Options list](https://nlog-project.org/config/) +For the possible options in the config, check the [Options list](https://nlog-project.org/config/) and [API Reference](https://nlog-project.org/documentation/) Having troubles? Check the [troubleshooting guide](https://github.com/NLog/NLog/wiki/Logging-troubleshooting) - - ----- - ℹ️ Looking for NLog 5? Just install NLog 4.5+! -NLog 4.5 implements the platforms added in NLog 5 (.NET Standard 1, .NET Standard 2, UWP, etc) and added structural logging, *without breaking changes*! + ℹ️ NLog 6.0 supports AOT + +[NLog 6.0](https://www.nuget.org/packages/NLog/) now available. See also [List of major changes in NLog 6.0](https://nlog-project.org/2025/04/29/nlog-6-0-major-changes.html) -NLog Packages +NLog Extensions --- -NLog consists of multiple packages. Most of the functionality is inside the NLog (core) package. What's inside the packages? See [targets](https://github.com/NLog/NLog/wiki/Targets) and [layout renderers](https://github.com/NLog/NLog/wiki/Layout-Renderers) overview! +The NLog-nuget-package provides everything needed for doing file- and console-logging. If you need other output options, then there are many NLog extension packages available (such as databases, email, cloud services, etc.). +See [targets](https://nlog-project.org/config/?tab=targets) and [layout renderers](https://nlog-project.org/config/?tab=layout-renderers) overview! -See Nuget/build status of all official packages [here](https://github.com/NLog/NLog/blob/dev/packages-and-status.md) +The NLog extension packages maintained by the NLog-project are [listed here](https://github.com/NLog/NLog/blob/dev/packages-and-status.md) with Nuget/build status. +It is also possible to [Create your own custom NLog extensions](https://github.com/NLog/NLog/wiki/Extending-NLog). Questions, bug reports or feature requests? --- -Issues with getting it working? -Please check the [troubleshooting guide](https://github.com/NLog/NLog/wiki/Logging-troubleshooting) before asking! With a clear error message, it's really easier to solve the issue! +If having issues with getting NLog working? Then please check the [troubleshooting guide](https://github.com/NLog/NLog/wiki/Logging-troubleshooting) before asking! This will often provide you with clear error message when asking, so it is easier to solve the issue! -Unclear how to configure NLog correctly of other questions? Please post questions on [StackOverflow](https://stackoverflow.com/). +If having questions about how to configure NLog correctly? Then please post questions on [StackOverflow](https://stackoverflow.com/questions/tagged/nlog) (using the `nlog` tag) -Do you have feature request or would you like to report a bug? Please post them on the [issue list](https://github.com/NLog/NLog/issues) and follow [these guidelines](.github/CONTRIBUTING.md). +Have you found a bug or issue with NLog functionality? Please post them on the [issue list](https://github.com/NLog/NLog/issues) and follow [these guidelines](/CONTRIBUTING.md). Frequently Asked Questions (FAQ) @@ -82,38 +72,7 @@ Frequently Asked Questions (FAQ) See [FAQ on the Wiki](https://github.com/NLog/NLog/wiki/faq) -Contributing ---- -As the current NLog team is a small team, we cannot fix every bug or implement every feature on our own. So contributions are really appreciated! - -If you like to start with a small task, then -[up-for-grabs](https://github.com/NLog/NLog/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs+-label%3A%22almost+ready%22+) are nice to start with. - - -A good way to get started (flow) - - -1. Fork the NLog repos. -1. Create a new branch in you current repos from the 'dev' branch. (critical bugfixes from 'master') -1. 'Check out' the code with Git or [GitHub Desktop](https://desktop.github.com/) -1. Check [contributing.md](.github/CONTRIBUTING.md#sync-projects) -1. Push commits and create a Pull Request (PR) to NLog - - License --- NLog is open source software, licensed under the terms of BSD license. See [LICENSE.txt](LICENSE.txt) for details. - - -How to build ---- -Use Visual Studio 2017 and open the solution 'NLog.sln' - C# 7.2 support is required. - -For building in the cloud we use: -- AppVeyor for Windows builds, including Silverlight and Xamarin. -- Travis for Mono builds. -- CodeCov for code coverage - -Trying to build your fork in the cloud? Check [this how-to](howto-build-your-fork.md) - diff --git a/SECURITY.md b/SECURITY.md index 4f8f938991..6bad768ba3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -6,9 +6,9 @@ Currently being supported with security updates. | Version | Supported | | ------- | ------------------ | -| 4.6.x | :white_check_mark: | -| 4.5.x | :white_check_mark: | -| < 4.5 | :x: | +| 6.x | :white_check_mark: | +| 5.x | :white_check_mark: | +| < 4.7 | :x: | ## Reporting a Vulnerability diff --git a/Test-XmlFile.ps1 b/Test-XmlFile.ps1 index ef898afa50..c194310fd7 100644 --- a/Test-XmlFile.ps1 +++ b/Test-XmlFile.ps1 @@ -52,6 +52,15 @@ function Test-XmlFile # Needs absolute paths. Will throw a error if one of the files is not found $pwd = get-location; - -# Returns true if valid -return Test-XmlFile "$pwd\src\NLog\bin\Release\NLog.xsd" "$pwd\src\NuGet\NLog.Config\content\NLog.config" +$testFilesDir = "$pwd\examples\targets\Configuration File" +$xsdFilePath = "$pwd\src\NLog\bin\Release\NLog.xsd" +$excludedTests = ("Database","Chainsaw","NLogViewer") +# Returns true if all selected tests in examples directory are valid +$ret = $true +Get-ChildItem -Path $testFilesDir -Directory -Exclude $excludedTests | Get-ChildItem -Recurse -File -Filter NLog.config | % { + $testOutcome = Test-XmlFile $xsdFilePath $_.FullName + if (-Not $testOutcome) { + $ret = $false + } +} +return $ret diff --git a/appveyor.yml b/appveyor.yml index e0cb7d4faf..46ee618737 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,44 +1,63 @@ -version: 4.6.0-{build} -image: Visual Studio 2017 +version: 6.0.0-{build} # Only change for mayor versions (e.g. 7.0) +image: + - Visual Studio 2022 + - Ubuntu2204 configuration: Release -clone_folder: c:\projects\nlog -environment: - github_auth_token: - secure: WYvd/k1xGCsDS+4iOhjzxA5/e36RjkxnuVOHpBR+eDtZNNjpYydCyNfd1COME9jI - sonar_token: - secure: OUI/jCbBF75TwKMPT+IfewdgwCgx9nQkRg3cYOEQNJeX5J2++oWS3dmpwO51XduP - -install: - - '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsDevCmd.bat"' - +build: false +test: false skip_tags: true skip_branch_with_pr: true -build_script: - - ps: .\build.ps1 - -test_script: - - msbuild /t:rebuild .\tools\CheckSourceCode\src\ /p:Configuration=Release /verbosity:minimal - - tools\CheckSourceCode\NLog.SourceCodeTests.exe no-interactive - - ps: .\run-tests.ps1 - -cache: - - src\packages -> **\packages.config - - c:\projects\nlog\appveyor.sonar\cache - -services: - - mssql2016 nuget: disable_publish_on_pr: true -artifacts: - - path: 'artifacts\*.nupkg' - - path: 'artifacts\*.snupkg' - -deploy: -- provider: NuGet - api_key: - secure: DtVDH1ZfIR8E2oDLeSPxfn0WFXw3MCv4WhLkkQQl9LfEHswb5sdxdCYodNKhrKik - on: - branch: master - +matrix: + fast_finish: true + +for: + - + matrix: + only: + - image: Visual Studio 2022 + environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + github_auth_token: + secure: WYvd/k1xGCsDS+4iOhjzxA5/e36RjkxnuVOHpBR+eDtZNNjpYydCyNfd1COME9jI + sonar_token: + secure: OUI/jCbBF75TwKMPT+IfewdgwCgx9nQkRg3cYOEQNJeX5J2++oWS3dmpwO51XduP + build_script: + - ps: ./build.ps1 + test_script: + - msbuild /t:rebuild .\tools\CheckSourceCode\src\ /p:Configuration=Release /verbosity:minimal + - tools\CheckSourceCode\NLog.SourceCodeTests.exe no-interactive + - ps: if (./Test-XmlFile.ps1) { Write-Output "Valid XSD" } else { exit 400 } + - ps: ./run-tests.ps1 + deploy: + - provider: NuGet + api_key: + secure: f6oWebyOFLpuuo2PMd6xgoxwMq+JvXVUmPyBme89zS7UF0zcvLYPSKN/p6B/KaMs + on: + branch: master + - provider: NuGet + api_key: + secure: f6oWebyOFLpuuo2PMd6xgoxwMq+JvXVUmPyBme89zS7UF0zcvLYPSKN/p6B/KaMs + on: + branch: dev + artifacts: + - path: 'artifacts\*.nupkg' + type: NuGetPackage + - path: 'artifacts\*.snupkg' + type: NuGetPackage + + - + matrix: + only: + - image: Ubuntu2204 + environment: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + MSBUILDTERMINALLOGGER: off + FrameworkPathOverride: /usr/lib/mono/4.6.1-api/ + build_script: + - ps: dotnet --version + test_script: + - ps: ./run-tests.ps1 diff --git a/build.ps1 b/build.ps1 index 46fb2d936e..b0078524d2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -2,11 +2,8 @@ # creates NuGet package at \artifacts dotnet --version -# dotnet restore .\src\NLog\ -# dotnet pack .\src\NLog\ --configuration release --include-symbols -o ..\..\artifacts - -$versionPrefix = "4.7.0" -$versionSuffix = "rc1" +$versionPrefix = "6.1.0" +$versionSuffix = "" $versionFile = $versionPrefix + "." + ${env:APPVEYOR_BUILD_NUMBER} $versionProduct = $versionPrefix; if (-Not $versionSuffix.Equals("")) @@ -18,7 +15,7 @@ if ($env:APPVEYOR_PULL_REQUEST_NUMBER) $versionSuffix = "PR" + $env:APPVEYOR_PULL_REQUEST_NUMBER } -$targetNugetExe = "tools\nuget.exe" +$targetNugetExe = "tools/nuget.exe" if (-Not (test-path $targetNugetExe)) { # download nuget.exe @@ -26,25 +23,24 @@ if (-Not (test-path $targetNugetExe)) Invoke-WebRequest $sourceNugetExe -OutFile $targetNugetExe } -msbuild /t:Restore,Pack .\src\NLog\ /p:targetFrameworks='"net45;net40-client;net35;netstandard1.3;netstandard1.5;netstandard2.0;sl4;sl5;wp8;monoandroid44;xamarinios10"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount +msbuild /t:Restore,Pack ./src/NLog/ /p:targetFrameworks='"net46;net45;net35;netstandard2.0;netstandard2.1"' /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount if (-Not $LastExitCode -eq 0) { exit $LastExitCode } -function create-package($packageName) +function create-package($packageName, $targetFrameworks) { - - $path = ".\src\$packageName\" - msbuild /t:Restore,Pack $path /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount + $path = "./src/$packageName/" + msbuild /t:Restore,Pack $path /p:targetFrameworks=$targetFrameworks /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount if (-Not $LastExitCode -eq 0) { exit $LastExitCode } - } -create-package('NLog.MSMQ') -create-package('NLog.Wcf') -create-package('NLog.WindowsEventLog') -create-package('NLog.WindowsIdentity') +create-package 'NLog.Targets.GZipFile' '"net45;net46;netstandard2.0;netstandard2.1"' +create-package 'NLog.OutputDebugString' '"net35;net45;net46;netstandard2.0;netstandard2.1"' +create-package 'NLog.RegEx' '"net35;net45;net46;netstandard2.0;netstandard2.1"' +msbuild /t:Restore,Pack ./src/NLog.Targets.AtomicFile/ /p:VersionPrefix=$versionPrefix /p:VersionSuffix=$versionSuffix /p:FileVersion=$versionFile /p:ProductVersion=$versionProduct /p:Configuration=Release /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:EmbedUntrackedSources=true /p:PackageOutputPath=..\..\artifacts /verbosity:minimal /maxcpucount +create-package 'NLog.WindowsEventLog' '"netstandard2.0;netstandard2.1"' -msbuild /t:xsd /t:NuGetSchemaPackage /t:NuGetConfigPackage .\src\NLog.proj /p:Configuration=Release /p:BuildNetFX45=true /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal +msbuild /t:xsd /t:NuGetSchemaPackage ./src/NLog.proj /p:Configuration=Release /p:BuildNetFX45=true /p:BuildVersion=$versionProduct /p:Configuration=Release /p:BuildLabelOverride=NONE /verbosity:minimal exit $LastExitCode diff --git a/codecov.yml b/codecov.yml deleted file mode 100644 index 3e0345b6d3..0000000000 --- a/codecov.yml +++ /dev/null @@ -1,17 +0,0 @@ -coverage: - precision: 0 - round: nearest - range: "50...90" - status: - patch: - default: - target: 50 - project: - default: - enabled: yes - threshold: 1 - -comment: - layout: "header, diff, changes, sunburst, uncovered" - branches: null - diff --git a/examples/ExtendingLoggers/InheritFromLogger/Program.cs b/examples/ExtendingLoggers/InheritFromLogger/Program.cs index 8c606772c8..d0ddbb1e34 100644 --- a/examples/ExtendingLoggers/InheritFromLogger/Program.cs +++ b/examples/ExtendingLoggers/InheritFromLogger/Program.cs @@ -1,35 +1,35 @@ -// -// Copyright (c) 2004-2006 Jaroslaw Kowalski -// +// +// Copyright (c) 2004-2024 Jaroslaw Kowalski +// // All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions // are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of Jaroslaw Kowalski nor the names of its +// and/or other materials provided with the distribution. +// +// * Neither the name of Jaroslaw Kowalski nor the names of its // contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// +// software without specific prior written permission. +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. -// +// using System; using System.Text; diff --git a/examples/ExtendingLoggers/InheritFromLogger/Properties/AssemblyInfo.cs b/examples/ExtendingLoggers/InheritFromLogger/Properties/AssemblyInfo.cs index a8d740c295..4fa56b84c8 100644 --- a/examples/ExtendingLoggers/InheritFromLogger/Properties/AssemblyInfo.cs +++ b/examples/ExtendingLoggers/InheritFromLogger/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +10,6 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("InheritFromLogger")] -[assembly: AssemblyCopyright("Copyright © Jaroslaw Kowalski. 2006")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/examples/ExtendingLoggers/LoggerWrapper/Program.cs b/examples/ExtendingLoggers/LoggerWrapper/Program.cs index 855e5cd591..569649563c 100644 --- a/examples/ExtendingLoggers/LoggerWrapper/Program.cs +++ b/examples/ExtendingLoggers/LoggerWrapper/Program.cs @@ -1,35 +1,35 @@ -// -// Copyright (c) 2004-2006 Jaroslaw Kowalski -// +// +// Copyright (c) 2004-2024 Jaroslaw Kowalski +// // All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions // are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of Jaroslaw Kowalski nor the names of its +// and/or other materials provided with the distribution. +// +// * Neither the name of Jaroslaw Kowalski nor the names of its // contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// +// software without specific prior written permission. +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. -// +// using System; using System.Text; diff --git a/examples/ExtendingLoggers/LoggerWrapper/Properties/AssemblyInfo.cs b/examples/ExtendingLoggers/LoggerWrapper/Properties/AssemblyInfo.cs index ae36b52850..3783b28257 100644 --- a/examples/ExtendingLoggers/LoggerWrapper/Properties/AssemblyInfo.cs +++ b/examples/ExtendingLoggers/LoggerWrapper/Properties/AssemblyInfo.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +10,6 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LoggerWrapper")] -[assembly: AssemblyCopyright("Copyright © Jaroslaw Kowalski 2006")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/examples/ExtendingLoggers/README.html b/examples/ExtendingLoggers/README.html index 2cb9e10d5a..8eaf306f23 100644 --- a/examples/ExtendingLoggers/README.html +++ b/examples/ExtendingLoggers/README.html @@ -1,10 +1,10 @@ - + + NLog Examples diff --git a/examples/NLog.Test/App.config b/examples/NLog.Test/App.config deleted file mode 100644 index 58227ff7b4..0000000000 --- a/examples/NLog.Test/App.config +++ /dev/null @@ -1,33 +0,0 @@ - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/examples/NLog.Test/Config1.nlog b/examples/NLog.Test/Config1.nlog deleted file mode 100644 index de99c7cb79..0000000000 --- a/examples/NLog.Test/Config1.nlog +++ /dev/null @@ -1,15 +0,0 @@ - - - -
- - - - - - - - - - - diff --git a/examples/NLog.Test/Config2.nlog b/examples/NLog.Test/Config2.nlog deleted file mode 100644 index c6a512e91f..0000000000 --- a/examples/NLog.Test/Config2.nlog +++ /dev/null @@ -1,15 +0,0 @@ - - - -
- - - - - - - - - - - diff --git a/examples/NLog.Test/NLog.Test.csproj b/examples/NLog.Test/NLog.Test.csproj deleted file mode 100644 index 60f7c40d61..0000000000 --- a/examples/NLog.Test/NLog.Test.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Local - 9.0.30729 - 2.0 - {5EC49108-97AE-40EA-B550-8960E4522718} - Debug - AnyCPU - - - - - NLog.Test - - - JScript - Grid - IE50 - false - Exe - NLog.Test - OnBuildSuccess - - - v3.5 - Client - - - bin\Debug\ - false - 285212672 - false - - - - - - - true - 4096 - false - - - false - false - false - false - 1 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - - - - - false - 4096 - false - - - false - false - false - false - 1 - none - prompt - - - - - Code - - - - - - - - - - - {C124B63D-1658-4311-9BA8-9C3CFAF9B32E} - NLog.netfx35 - - - - - 3.5 - - - - - - - - - - \ No newline at end of file diff --git a/examples/NLog.Test/Test.cs b/examples/NLog.Test/Test.cs deleted file mode 100644 index 197e2a36a7..0000000000 --- a/examples/NLog.Test/Test.cs +++ /dev/null @@ -1,103 +0,0 @@ -// -// Copyright (c) 2004-2009 Jaroslaw Kowalski -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// -// * Redistributions of source code must retain the above copyright notice, -// this list of conditions and the following disclaimer. -// -// * Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// * Neither the name of Jaroslaw Kowalski nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -// THE POSSIBILITY OF SUCH DAMAGE. -// - -using System; -using NLog.Config; -using NLog.Targets; -using NLog.Layouts; - -namespace NLog.Test -{ - public static class ExtensionMethods - { - - } - - public class Test - { - private static readonly ILogger logger = LogManager.GetCurrentClassLogger(); - - public static void LogProc(string msg) - { - Console.WriteLine("logproc: {0}", msg); - } - - static void A() - { - B(3); - } - - static void B(int a) - { - logger.Trace("ttt"); - logger.Debug("ala ma kota"); - logger.Info("ala ma kanarka"); - logger.Warn("aaa"); - logger.Error("err"); - logger.Fatal("fff"); - } - - static void Main(string[]args) - { - Target t; - - // t.WriteLogEvent() - //ConsoleTarget ct = new ConsoleTarget(); - //ct.Layout = "${message} ${longdate} ${replace:searchFor=(..):regex=true:wholeWords=true:replaceWith=[xx'$1'yy]:inner=${rot13:inner=${message}:uppercase=true:padding=-10}}"; - - //CsvLayout csv = new CsvLayout(); - //csv.Columns.Add(new CsvColumn("msg", "${message}")); - //csv.Columns.Add(new CsvColumn("date", "${longdate}")); - //csv.Columns.Add(new CsvColumn("level", "${level}")); - //csv.WithHeader = true; - ////ct.Layout = csv; - - //SimpleConfigurator.ConfigureForTargetLogging(ct); - - //InternalLogger.LogToConsole = true; - //InternalLogger.LogLevel = LogLevel.Debug; - - logger.Debug(() => "foo bar"); - - for (int i = 0; i < 3; ++i) - { - logger.Trace("ttt"); - logger.Debug("ala ma kota {0}", i); - logger.Info("ala ma kanarka"); - logger.Warn("aaa"); - logger.Error("err"); - logger.Fatal("fff"); - } - } - } -} \ No newline at end of file diff --git a/examples/NLogDemo/Default.aspx b/examples/NLogDemo/Default.aspx deleted file mode 100644 index 553d2d3da3..0000000000 --- a/examples/NLogDemo/Default.aspx +++ /dev/null @@ -1,66 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="NLogDemo._Default" %> - - - - NLog Demo - - - -
-
- NLog - Advanced .NET Logging -
-

NLog Demo

-

- This demo shows an ASP.NET web application with multiple log outputs: -

-
    -
  • Mail - logs from each HTTP request are sent to GMail account.
    You can specify GMail username in <%= Server.MapPath("~/gmailusername.txt")%> and password <%= Server.MapPath("~/gmailpassword.txt")%>
  • -
  • Database - logs are written to LogEntries tables in MyLogs database in local SQLEXPRESS database
  • -
  • File - log files are written to "><%= Server.MapPath("~/logs") %> directory.
  • -
  • Event Log - logs are written to Application log using NLog Demo source name.
  • -
  • Performance Counter - each time log message is written, the performance counter My Log\My Counter is incremented.
  • -
-

- NOTE: Some of the log outputs (database, event log source) must be installed before logs can be written to them. - To do this, open elevated command prompt and run: -

-
InstallNLogConfig.exe <%= Server.MapPath("NLog.config") %>
-

- - NLog configuration file can be found at: - <%= Server.MapPath("~/NLog.config") %>. You can modify the file at any time and logging configuration will - be automatically reloaded.

-

Simple calculator

-

- Enter two openrands and operator to compute the result of arithmetic operation. -
- You may introduce errors (such as divide by zero) and see what gets written to the log. - Under normal circumstances only messages with log level Info or above are written, but whenever the error occurs more detailed trace is logged, which includes all messages - -

-
- Operand 1: - - - Operator: - - - - - - - - - Operand 2: - - -
- Result: - - - -
-
- - diff --git a/examples/NLogDemo/Default.aspx.cs b/examples/NLogDemo/Default.aspx.cs deleted file mode 100644 index 342fcf9a28..0000000000 --- a/examples/NLogDemo/Default.aspx.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; - -namespace NLogDemo -{ - public partial class _Default : System.Web.UI.Page - { - private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); - - protected void Page_Load(object sender, EventArgs e) - { - logger.Info("Page_Load called"); - if (!this.IsPostBack) - { - this.textboxOperand1.Text = "1"; - this.textboxOperand2.Text = "1"; - this.dropdownOperator.SelectedValue = "Add"; - } - - this.Compute(); - } - - protected void Page_LoadComplete(object sender, EventArgs e) - { - logger.Trace("Page_LoadComplete called"); - } - - protected void Page_Unload(object sender, EventArgs e) - { - logger.Trace("Page_Unload called"); - } - - private void Compute() - { - try - { - string op1 = this.textboxOperand1.Text; - string op2 = this.textboxOperand2.Text; - - logger.Trace("Op1: '{0}'", op1); - logger.Trace("Op2: '{0}'", op2); - - switch (this.dropdownOperator.SelectedValue) - { - case "Add": - this.textboxResult.Text = (Convert.ToInt32(op1) + Convert.ToInt32(op2)).ToString(); - break; - - case "Subtract": - this.textboxResult.Text = (Convert.ToInt32(op1) - Convert.ToInt32(op2)).ToString(); - break; - - case "Multiply": - this.textboxResult.Text = (Convert.ToInt32(op1) * Convert.ToInt32(op2)).ToString(); - break; - - case "Divide": - this.textboxResult.Text = (Convert.ToInt32(op1) / Convert.ToInt32(op2)).ToString(); - break; - - case "Modulo": - this.textboxResult.Text = (Convert.ToInt32(op1) % Convert.ToInt32(op2)).ToString(); - break; - - default: - throw new NotSupportedException("Not supported operator: " + this.dropdownOperator.SelectedValue); - } - - this.labelError.Text = string.Empty; - logger.Info("Result computed successfully."); - } - catch (Exception ex) - { - logger.Error("ERROR: {0}", ex); - this.labelError.Text = ex.ToString(); - this.textboxResult.Text = "(error)"; - } - } - } -} \ No newline at end of file diff --git a/examples/NLogDemo/Default.aspx.designer.cs b/examples/NLogDemo/Default.aspx.designer.cs deleted file mode 100644 index 84641c99e6..0000000000 --- a/examples/NLogDemo/Default.aspx.designer.cs +++ /dev/null @@ -1,69 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NLogDemo { - - - public partial class _Default { - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// textboxOperand1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox textboxOperand1; - - /// - /// dropdownOperator control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList dropdownOperator; - - /// - /// textboxOperand2 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox textboxOperand2; - - /// - /// textboxResult control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox textboxResult; - - /// - /// labelError control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label labelError; - } -} diff --git a/examples/NLogDemo/NLog.config b/examples/NLogDemo/NLog.config deleted file mode 100644 index dea3a45995..0000000000 --- a/examples/NLogDemo/NLog.config +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - - - - - - - - - - - - INSERT INTO [LogEntries](TimeStamp, Message, Level, Logger) VALUES(getutcdate(), @msg, @level, @logger) - - - - - - - - System.Data.SqlClient - server=.\SQLEXPRESS;database=MyLogs;integrated security=sspi - - - - CREATE DATABASE MyLogs - server=.\SQLEXPRESS;database=master;integrated security=sspi - true - - - - - CREATE TABLE LogEntries( - id int primary key not null identity(1,1), - TimeStamp datetime2, - Message nvarchar(max), - level nvarchar(10), - logger nvarchar(128)) - - - - - - DROP DATABASE MyLogs - server=.\SQLEXPRESS;database=master;integrated security=sspi - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - level >= LogLevel.Info - - - - - - - - - - - \ No newline at end of file diff --git a/examples/NLogDemo/NLog.png b/examples/NLogDemo/NLog.png deleted file mode 100644 index 299747d7ce..0000000000 Binary files a/examples/NLogDemo/NLog.png and /dev/null differ diff --git a/examples/NLogDemo/NLogDemo.csproj b/examples/NLogDemo/NLogDemo.csproj deleted file mode 100644 index 06ba94015a..0000000000 --- a/examples/NLogDemo/NLogDemo.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {8F952123-BADC-46A5-A204-A161F0711A39} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - NLogDemo - NLogDemo - v4.0 - - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - - - - - - - - - - {A961A1F9-1024-4446-BF9E-A923137340B8} - NLog.Extended.netfx40 - - - {A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66} - NLog.netfx40 - - - - - - - - - False - True - 55366 - / - - - False - False - - - False - - - - - - \ No newline at end of file diff --git a/examples/NLogDemo/NLogDemo.sln b/examples/NLogDemo/NLogDemo.sln deleted file mode 100644 index f7bf222119..0000000000 --- a/examples/NLogDemo/NLogDemo.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLogDemo", "NLogDemo.csproj", "{8F952123-BADC-46A5-A204-A161F0711A39}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.netfx40", "..\..\src\NLog\NLog.netfx40.csproj", "{A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NLog.Extended.netfx40", "..\..\src\NLog.Extended\NLog.Extended.netfx40.csproj", "{A961A1F9-1024-4446-BF9E-A923137340B8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8F952123-BADC-46A5-A204-A161F0711A39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8F952123-BADC-46A5-A204-A161F0711A39}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8F952123-BADC-46A5-A204-A161F0711A39}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8F952123-BADC-46A5-A204-A161F0711A39}.Release|Any CPU.Build.0 = Release|Any CPU - {A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A0BFF0DB-ED9A-4639-AE86-8E709A1EFC66}.Release|Any CPU.Build.0 = Release|Any CPU - {A961A1F9-1024-4446-BF9E-A923137340B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A961A1F9-1024-4446-BF9E-A923137340B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A961A1F9-1024-4446-BF9E-A923137340B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A961A1F9-1024-4446-BF9E-A923137340B8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/examples/NLogDemo/Properties/AssemblyInfo.cs b/examples/NLogDemo/Properties/AssemblyInfo.cs deleted file mode 100644 index f6d723762a..0000000000 --- a/examples/NLogDemo/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NLogDemo")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Jaroslaw Kowalski")] -[assembly: AssemblyProduct("NLogDemo")] -[assembly: AssemblyCopyright("Copyright © Jaroslaw Kowalski 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5304ea1f-d9ad-4cd9-b019-b2667dc456e2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/examples/NLogDemo/Scripts/jquery-1.4.1-vsdoc.js b/examples/NLogDemo/Scripts/jquery-1.4.1-vsdoc.js deleted file mode 100644 index 681241d10c..0000000000 --- a/examples/NLogDemo/Scripts/jquery-1.4.1-vsdoc.js +++ /dev/null @@ -1,8061 +0,0 @@ -/* - * This file has been commented to support Visual Studio Intellisense. - * You should not use this file at runtime inside the browser--it is only - * intended to be used only for design-time IntelliSense. Please use the - * standard jQuery library for all production use. - * - * Comment version: 1.4.1a - */ - -/*! - * jQuery JavaScript Library v1.4.1 - * http://jquery.com/ - * - * Distributed in whole under the terms of the MIT - * - * Copyright 2010, John Resig - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Mon Jan 25 19:43:33 2010 -0500 - */ - -(function( window, undefined ) { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - /// - /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. - /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. - /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). - /// 4: $(callback) - A shorthand for $(document).ready(). - /// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned. - /// - /// - /// 1: expression - An expression to search with. - /// 2: html - A string of HTML to create on the fly. - /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. - /// 4: callback - The function to execute when the DOM is ready. - /// - /// - /// 1: context - A DOM Element, Document or jQuery to use as context. - /// - /// - - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // Use the correct document accordingly with window argument (sandbox) - document = window.document, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // (both of which we optimize for) - quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/, - - // Is it a simple selector - isSimple = /^.[^:#\[\.,]*$/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // Has the ready events already been bound? - readyBound = false, - - // The functions to execute on DOM ready - readyList = [], - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwnProperty = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - indexOf = Array.prototype.indexOf; - -jQuery.fn = jQuery.prototype = { - init: function( selector, context ) { - - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - match = quickExpr.exec( selector ); - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - doc = (context ? context.ownerDocument || context : document); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = buildFragment( [ match[1] ], [ doc ] ); - selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; - } - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - if ( elem ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $("TAG") - } else if ( !context && /^\w+$/.test( selector ) ) { - this.selector = selector; - this.context = document; - selector = document.getElementsByTagName( selector ); - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return (context || rootjQuery).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return jQuery( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if (selector.selector !== undefined) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.isArray( selector ) ? - this.setArray( selector ) : - jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.4.1", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - /// - /// The number of elements currently matched. - /// Part of Core - /// - /// - - return this.length; - }, - - toArray: function() { - /// - /// Retrieve all the DOM elements contained in the jQuery set, as an array. - /// - /// - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - /// - /// Access a single matched element. num is used to access the - /// Nth element matched. - /// Part of Core - /// - /// - /// - /// Access the element in the Nth position. - /// - - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - /// - /// Set the jQuery object to an array of elements, while maintaining - /// the stack. - /// Part of Core - /// - /// - /// - /// An array of elements - /// - - // Build a new jQuery matched element set - var ret = jQuery( elems || null ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + (this.selector ? " " : "") + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Force the current matched set of elements to become - // the specified array of elements (destroying the stack in the process) - // You should use pushStack() in order to do this, but maintain the stack - setArray: function( elems ) { - /// - /// Set the jQuery object to an array of elements. This operation is - /// completely destructive - be sure to use .pushStack() if you wish to maintain - /// the jQuery stack. - /// Part of Core - /// - /// - /// - /// An array of elements - /// - - // Resetting the length to 0, then using the native Array push - // is a super-fast way to populate an object with array-like properties - this.length = 0; - push.apply( this, elems ); - - return this; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - /// - /// Execute a function within the context of every matched element. - /// This means that every time the passed-in function is executed - /// (which is once for every element matched) the 'this' keyword - /// points to the specific element. - /// Additionally, the function, when executed, is passed a single - /// argument representing the position of the element in the matched - /// set. - /// Part of Core - /// - /// - /// - /// A function to execute - /// - - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - /// - /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. - /// - /// The function to be executed when the DOM is ready. - - // Attach the listeners - jQuery.bindReady(); - - // If the DOM is already ready - if ( jQuery.isReady ) { - // Execute the function immediately - fn.call( document, jQuery ); - - // Otherwise, remember the function for later - } else if ( readyList ) { - // Add the function to the wait list - readyList.push( fn ); - } - - return this; - }, - - eq: function( i ) { - /// - /// Reduce the set of matched elements to a single element. - /// The position of the element in the set of matched elements - /// starts at 0 and goes to length - 1. - /// Part of Core - /// - /// - /// - /// pos The index of the element that you wish to limit to. - /// - - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - /// - /// Reduce the set of matched elements to the first in the set. - /// - /// - - return this.eq( 0 ); - }, - - last: function() { - /// - /// Reduce the set of matched elements to the final one in the set. - /// - /// - - return this.eq( -1 ); - }, - - slice: function() { - /// - /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. - /// - /// Where to start the subset (0-based). - /// Where to end the subset (not including the end element itself). - /// If omitted, ends at the end of the selection - /// The sliced elements - - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - /// - /// This member is internal. - /// - /// - /// - - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - /// - /// End the most recent 'destructive' operation, reverting the list of matched elements - /// back to its previous state. After an end operation, the list of matched elements will - /// revert to the last state of matched elements. - /// If there was no destructive operation before, an empty set is returned. - /// Part of DOM/Traversing - /// - /// - - return this.prevObject || jQuery(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - /// - /// Extend one object with one or more others, returning the original, - /// modified, object. This is a great utility for simple inheritance. - /// jQuery.extend(settings, options); - /// var settings = jQuery.extend({}, defaults, options); - /// Part of JavaScript - /// - /// - /// The object to extend - /// - /// - /// The object that will be merged into the first. - /// - /// - /// (optional) More objects to merge into the first - /// - /// - - // copy reference to target object - var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging object literal values or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) { - var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src - : jQuery.isArray(copy) ? [] : {}; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - /// - /// Run this function to give control of the $ variable back - /// to whichever library first implemented it. This helps to make - /// sure that jQuery doesn't conflict with the $ object - /// of other libraries. - /// By using this function, you will only be able to access jQuery - /// using the 'jQuery' variable. For example, where you used to do - /// $("div p"), you now must do jQuery("div p"). - /// Part of Core - /// - /// - - window.$ = _$; - - if ( deep ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // Handle when the DOM is ready - ready: function() { - /// - /// This method is internal. - /// - /// - - // Make sure that the DOM is not already loaded - if ( !jQuery.isReady ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 13 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If there are functions bound, to execute - if ( readyList ) { - // Execute all of them - var fn, i = 0; - while ( (fn = readyList[ i++ ]) ) { - fn.call( document, jQuery ); - } - - // Reset the list of functions - readyList = null; - } - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyBound ) { - return; - } - - readyBound = true; - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - return jQuery.ready(); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent("onreadystatechange", DOMContentLoaded); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - /// - /// Determines if the parameter passed is a function. - /// - /// The object to check - /// True if the parameter is a function; otherwise false. - - return toString.call(obj) === "[object Function]"; - }, - - isArray: function( obj ) { - /// - /// Determine if the parameter passed is an array. - /// - /// Object to test whether or not it is an array. - /// True if the parameter is a function; otherwise false. - - return toString.call(obj) === "[object Array]"; - }, - - isPlainObject: function( obj ) { - /// - /// Check to see if an object is a plain object (created using "{}" or "new Object"). - /// - /// - /// The object that will be checked to see if it's a plain object. - /// - /// - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { - return false; - } - - // Not own constructor property must be Object - if ( obj.constructor - && !hasOwnProperty.call(obj, "constructor") - && !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwnProperty.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - /// - /// Check to see if an object is empty (contains no properties). - /// - /// - /// The object that will be checked to see if it's empty. - /// - /// - - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@") - .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]") - .replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) { - - // Try to use the native JSON parser first - return window.JSON && window.JSON.parse ? - window.JSON.parse( data ) : - (new Function("return " + data))(); - - } else { - jQuery.error( "Invalid JSON: " + data ); - } - }, - - noop: function() { - /// - /// An empty function. - /// - /// - }, - - // Evalulates a script in a global context - globalEval: function( data ) { - /// - /// Internally evaluates a script in a global context. - /// - /// - - if ( data && rnotwhite.test(data) ) { - // Inspired by code by Andrea Giammarchi - // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html - var head = document.getElementsByTagName("head")[0] || document.documentElement, - script = document.createElement("script"); - - script.type = "text/javascript"; - - if ( jQuery.support.scriptEval ) { - script.appendChild( document.createTextNode( data ) ); - } else { - script.text = data; - } - - // Use insertBefore instead of appendChild to circumvent an IE6 bug. - // This arises when a base node is used (#2709). - head.insertBefore( script, head.firstChild ); - head.removeChild( script ); - } - }, - - nodeName: function( elem, name ) { - /// - /// Checks whether the specified element has the specified DOM node name. - /// - /// The element to examine - /// The node name to check - /// True if the specified node name matches the node's DOM node name; otherwise false - - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - /// - /// A generic iterator function, which can be used to seemlessly - /// iterate over both objects and arrays. This function is not the same - /// as $().each() - which is used to iterate, exclusively, over a jQuery - /// object. This function can be used to iterate over anything. - /// The callback has two arguments:the key (objects) or index (arrays) as first - /// the first, and the value as the second. - /// Part of JavaScript - /// - /// - /// The object, or array, to iterate over. - /// - /// - /// The function that will be executed on every object. - /// - /// - - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction(object); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( var value = object[0]; - i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} - } - } - - return object; - }, - - trim: function( text ) { - /// - /// Remove the whitespace from the beginning and end of a string. - /// Part of JavaScript - /// - /// - /// - /// The string to trim. - /// - - return (text || "").replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - /// - /// Turns anything into a true array. This is an internal method. - /// - /// Anything to turn into an actual Array - /// - /// - - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array ) { - if ( array.indexOf ) { - return array.indexOf( elem ); - } - - for ( var i = 0, length = array.length; i < length; i++ ) { - if ( array[ i ] === elem ) { - return i; - } - } - - return -1; - }, - - merge: function( first, second ) { - /// - /// Merge two arrays together, removing all duplicates. - /// The new array is: All the results from the first array, followed - /// by the unique results from the second array. - /// Part of JavaScript - /// - /// - /// - /// The first array to merge. - /// - /// - /// The second array to merge. - /// - - var i = first.length, j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - /// - /// Filter items out of an array, by using a filter function. - /// The specified function will be passed two arguments: The - /// current array item and the index of the item in the array. The - /// function must return 'true' to keep the item in the array, - /// false to remove it. - /// }); - /// Part of JavaScript - /// - /// - /// - /// array The Array to find items in. - /// - /// - /// The function to process each item against. - /// - /// - /// Invert the selection - select the opposite of the function. - /// - - var ret = []; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - if ( !inv !== !callback( elems[ i ], i ) ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - /// - /// Translate all items in an array to another array of items. - /// The translation function that is provided to this method is - /// called for each item in the array and is passed one argument: - /// The item to be translated. - /// The function can then return the translated value, 'null' - /// (to remove the item), or an array of values - which will - /// be flattened into the full array. - /// Part of JavaScript - /// - /// - /// - /// array The Array to translate. - /// - /// - /// The function to process each item against. - /// - - var ret = [], value; - - // Go through the array, translating each of the items to their - // new value (or values). - for ( var i = 0, length = elems.length; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - proxy: function( fn, proxy, thisObject ) { - /// - /// Takes a function and returns a new one that will always have a particular scope. - /// - /// - /// The function whose scope will be changed. - /// - /// - /// The object to which the scope of the function should be set. - /// - /// - - if ( arguments.length === 2 ) { - if ( typeof proxy === "string" ) { - thisObject = fn; - fn = thisObject[ proxy ]; - proxy = undefined; - - } else if ( proxy && !jQuery.isFunction( proxy ) ) { - thisObject = proxy; - proxy = undefined; - } - } - - if ( !proxy && fn ) { - proxy = function() { - return fn.apply( thisObject || this, arguments ); - }; - } - - // Set the guid of unique handler to the same of original handler, so it can be removed - if ( fn ) { - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - } - - // So proxy can be declared as an argument - return proxy; - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) || - /(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) || - /(msie) ([\w.]+)/.exec( ua ) || - !/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - browser: {} -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -if ( indexOf ) { - jQuery.inArray = function( elem, array ) { - /// - /// Determines the index of the first parameter in the array. - /// - /// The value to see if it exists in the array. - /// The array to look through for the value - /// The 0-based index of the item if it was found, otherwise -1. - - return indexOf.call( array, elem ); - }; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch( error ) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -function evalScript( i, elem ) { - /// - /// This method is internal. - /// - /// - - if ( elem.src ) { - jQuery.ajax({ - url: elem.src, - async: false, - dataType: "script" - }); - } else { - jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" ); - } - - if ( elem.parentNode ) { - elem.parentNode.removeChild( elem ); - } -} - -// Mutifunctional method to get and set values to a collection -// The value/s can be optionally by executed if its a function -function access( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : null; -} - -function now() { - /// - /// Gets the current date. - /// - /// The current date. - - return (new Date).getTime(); -} - -// [vsdoc] The following function has been modified for IntelliSense. -// [vsdoc] Stubbing support properties to "false" for IntelliSense compat. -(function() { - - jQuery.support = {}; - - // var root = document.documentElement, - // script = document.createElement("script"), - // div = document.createElement("div"), - // id = "script" + now(); - - // div.style.display = "none"; - // div.innerHTML = "
a"; - - // var all = div.getElementsByTagName("*"), - // a = div.getElementsByTagName("a")[0]; - - // // Can't get basic test support - // if ( !all || !all.length || !a ) { - // return; - // } - - jQuery.support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: false, - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: false, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: false, - - // Get the style information from getAttribute - // (IE uses .cssText insted) - style: false, - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: false, - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: false, - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: false, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: false, - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: false, - - // Will be defined later - checkClone: false, - scriptEval: false, - noCloneEvent: false, - boxModel: false - }; - - // script.type = "text/javascript"; - // try { - // script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); - // } catch(e) {} - - // root.insertBefore( script, root.firstChild ); - - // // Make sure that the execution of code works by injecting a script - // // tag with appendChild/createTextNode - // // (IE doesn't support this, fails, and uses .text instead) - // if ( window[ id ] ) { - // jQuery.support.scriptEval = true; - // delete window[ id ]; - // } - - // root.removeChild( script ); - - // if ( div.attachEvent && div.fireEvent ) { - // div.attachEvent("onclick", function click() { - // // Cloning a node shouldn't copy over any - // // bound event handlers (IE does this) - // jQuery.support.noCloneEvent = false; - // div.detachEvent("onclick", click); - // }); - // div.cloneNode(true).fireEvent("onclick"); - // } - - // div = document.createElement("div"); - // div.innerHTML = ""; - - // var fragment = document.createDocumentFragment(); - // fragment.appendChild( div.firstChild ); - - // // WebKit doesn't clone checked state correctly in fragments - // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; - - // // Figure out if the W3C box model works as expected - // // document.body must exist before we can do this - // jQuery(function() { - // var div = document.createElement("div"); - // div.style.width = div.style.paddingLeft = "1px"; - - // document.body.appendChild( div ); - // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; - // document.body.removeChild( div ).style.display = 'none'; - // div = null; - // }); - - // // Technique from Juriy Zaytsev - // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ - // var eventSupported = function( eventName ) { - // var el = document.createElement("div"); - // eventName = "on" + eventName; - - // var isSupported = (eventName in el); - // if ( !isSupported ) { - // el.setAttribute(eventName, "return;"); - // isSupported = typeof el[eventName] === "function"; - // } - // el = null; - - // return isSupported; - // }; - - jQuery.support.submitBubbles = false; - jQuery.support.changeBubbles = false; - - // // release memory in IE - // root = script = div = all = a = null; -})(); - -jQuery.props = { - "for": "htmlFor", - "class": "className", - readonly: "readOnly", - maxlength: "maxLength", - cellspacing: "cellSpacing", - rowspan: "rowSpan", - colspan: "colSpan", - tabindex: "tabIndex", - usemap: "useMap", - frameborder: "frameBorder" -}; -var expando = "jQuery" + now(), uuid = 0, windowData = {}; -var emptyObject = {}; - -jQuery.extend({ - cache: {}, - - expando:expando, - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - "object": true, - "applet": true - }, - - data: function( elem, name, data ) { - /// - /// Store arbitrary data associated with the specified element. - /// - /// - /// The DOM element to associate with the data. - /// - /// - /// A string naming the piece of data to set. - /// - /// - /// The new data value. - /// - /// - - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ], cache = jQuery.cache, thisCache; - - // Handle the case where there's no name immediately - if ( !name && !id ) { - return null; - } - - // Compute a unique ID for the element - if ( !id ) { - id = ++uuid; - } - - // Avoid generating a new cache unless none exists and we - // want to manipulate it. - if ( typeof name === "object" ) { - elem[ expando ] = id; - thisCache = cache[ id ] = jQuery.extend(true, {}, name); - } else if ( cache[ id ] ) { - thisCache = cache[ id ]; - } else if ( typeof data === "undefined" ) { - thisCache = emptyObject; - } else { - thisCache = cache[ id ] = {}; - } - - // Prevent overriding the named cache with undefined values - if ( data !== undefined ) { - elem[ expando ] = id; - thisCache[ name ] = data; - } - - return typeof name === "string" ? thisCache[ name ] : thisCache; - }, - - removeData: function( elem, name ) { - if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) { - return; - } - - elem = elem == window ? - windowData : - elem; - - var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ]; - - // If we want to remove a specific section of the element's data - if ( name ) { - if ( thisCache ) { - // Remove the section of cache data - delete thisCache[ name ]; - - // If we've removed all the data, remove the element's cache - if ( jQuery.isEmptyObject(thisCache) ) { - jQuery.removeData( elem ); - } - } - - // Otherwise, we want to remove all of the element's data - } else { - // Clean up the element expando - try { - delete elem[ expando ]; - } catch( e ) { - // IE has trouble directly removing the expando - // but it's ok with using removeAttribute - if ( elem.removeAttribute ) { - elem.removeAttribute( expando ); - } - } - - // Completely remove the data cache - delete cache[ id ]; - } - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - /// - /// Store arbitrary data associated with the matched elements. - /// - /// - /// A string naming the piece of data to set. - /// - /// - /// The new data value. - /// - /// - - if ( typeof key === "undefined" && this.length ) { - return jQuery.data( this[0] ); - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - var parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - } - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - } else { - return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() { - jQuery.data( this, key, value ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); -jQuery.extend({ - queue: function( elem, type, data ) { - if ( !elem ) { - return; - } - - type = (type || "fx") + "queue"; - var q = jQuery.data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( !data ) { - return q || []; - } - - if ( !q || jQuery.isArray(data) ) { - q = jQuery.data( elem, type, jQuery.makeArray(data) ); - - } else { - q.push( data ); - } - - return q; - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), fn = queue.shift(); - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift("inprogress"); - } - - fn.call(elem, function() { - jQuery.dequeue(elem, type); - }); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - /// - /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). - /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. - /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). - /// - /// The function to add to the queue. - /// - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function( i, elem ) { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - /// - /// Removes a queued function from the front of the queue and executes it. - /// - /// The type of queue to access. - /// - - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - /// - /// Set a timer to delay execution of subsequent items in the queue. - /// - /// - /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. - /// - /// - /// A string containing the name of the queue. Defaults to fx, the standard effects queue. - /// - /// - - time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; - type = type || "fx"; - - return this.queue( type, function() { - var elem = this; - setTimeout(function() { - jQuery.dequeue( elem, type ); - }, time ); - }); - }, - - clearQueue: function( type ) { - /// - /// Remove from the queue all items that have not yet been run. - /// - /// - /// A string containing the name of the queue. Defaults to fx, the standard effects queue. - /// - /// - - return this.queue( type || "fx", [] ); - } -}); -var rclass = /[\n\t]/g, - rspace = /\s+/, - rreturn = /\r/g, - rspecialurl = /href|src|style/, - rtype = /(button|input)/i, - rfocusable = /(button|input|object|select|textarea)/i, - rclickable = /^(a|area)$/i, - rradiocheck = /radio|checkbox/; - -jQuery.fn.extend({ - attr: function( name, value ) { - /// - /// Set a single property to a computed value, on all matched elements. - /// Instead of a value, a function is provided, that computes the value. - /// Part of DOM/Attributes - /// - /// - /// - /// The name of the property to set. - /// - /// - /// A function returning the value to set. - /// - - return access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name, fn ) { - /// - /// Remove an attribute from each of the matched elements. - /// Part of DOM/Attributes - /// - /// - /// An attribute to remove. - /// - /// - - return this.each(function(){ - jQuery.attr( this, name, "" ); - if ( this.nodeType === 1 ) { - this.removeAttribute( name ); - } - }); - }, - - addClass: function( value ) { - /// - /// Adds the specified class(es) to each of the set of matched elements. - /// Part of DOM/Attributes - /// - /// - /// One or more class names to be added to the class attribute of each matched element. - /// - /// - - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.addClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( value && typeof value === "string" ) { - var classNames = (value || "").split( rspace ); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className ) { - elem.className = value; - - } else { - var className = " " + elem.className + " "; - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { - elem.className += " " + classNames[c]; - } - } - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - /// - /// Removes all or the specified class(es) from the set of matched elements. - /// Part of DOM/Attributes - /// - /// - /// (Optional) A class name to be removed from the class attribute of each matched element. - /// - /// - - if ( jQuery.isFunction(value) ) { - return this.each(function(i) { - var self = jQuery(this); - self.removeClass( value.call(this, i, self.attr("class")) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - var classNames = (value || "").split(rspace); - - for ( var i = 0, l = this.length; i < l; i++ ) { - var elem = this[i]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - var className = (" " + elem.className + " ").replace(rclass, " "); - for ( var c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[c] + " ", " "); - } - elem.className = className.substring(1, className.length - 1); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - /// - /// Add or remove a class from each element in the set of matched elements, depending - /// on either the class's presence or the value of the switch argument. - /// - /// - /// A class name to be toggled for each element in the matched set. - /// - /// - /// A boolean value to determine whether the class should be added or removed. - /// - /// - - var type = typeof value, isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function(i) { - var self = jQuery(this); - self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, i = 0, self = jQuery(this), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery.data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - /// - /// Checks the current selection against a class and returns whether at least one selection has a given class. - /// - /// The class to check against - /// True if at least one element in the selection has the class, otherwise false. - - var className = " " + selector + " "; - for ( var i = 0, l = this.length; i < l; i++ ) { - if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - /// - /// Set the value of every matched element. - /// Part of DOM/Attributes - /// - /// - /// - /// A string of text or an array of strings to set as the value property of each - /// matched element. - /// - - if ( value === undefined ) { - var elem = this[0]; - - if ( elem ) { - if ( jQuery.nodeName( elem, "option" ) ) { - return (elem.attributes.value || {}).specified ? elem.value : elem.text; - } - - // We need to handle select boxes special - if ( jQuery.nodeName( elem, "select" ) ) { - var index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { - var option = options[ i ]; - - if ( option.selected ) { - // Get the specifc value for the option - value = jQuery(option).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - return values; - } - - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { - return elem.getAttribute("value") === null ? "on" : elem.value; - } - - - // Everything else, we just grab the value - return (elem.value || "").replace(rreturn, ""); - - } - - return undefined; - } - - var isFunction = jQuery.isFunction(value); - - return this.each(function(i) { - var self = jQuery(this), val = value; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call(this, i, self.val()); - } - - // Typecast each time if the value is a Function and the appended - // value is therefore different each time. - if ( typeof val === "number" ) { - val += ""; - } - - if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { - this.checked = jQuery.inArray( self.val(), val ) >= 0; - - } else if ( jQuery.nodeName( this, "select" ) ) { - var values = jQuery.makeArray(val); - - jQuery( "option", this ).each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - this.selectedIndex = -1; - } - - } else { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - /// - /// This method is internal. - /// - /// - - // don't set attributes on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery(elem)[name](value); - } - - var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), - // Whether we are setting (or getting) - set = value !== undefined; - - // Try to normalize/fix the name - name = notxml && jQuery.props[ name ] || name; - - // Only do all the following if this is a node (faster for style) - if ( elem.nodeType === 1 ) { - // These attributes require special treatment - var special = rspecialurl.test( name ); - - // Safari mis-reports the default selected property of an option - // Accessing the parent's selectedIndex property fixes it - if ( name === "selected" && !jQuery.support.optSelected ) { - var parent = elem.parentNode; - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - } - - // If applicable, access the attribute via the DOM 0 way - if ( name in elem && notxml && !special ) { - if ( set ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } - - elem[ name ] = value; - } - - // browsers index elements by id/name on forms, give priority to attributes. - if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { - return elem.getAttributeNode( name ).nodeValue; - } - - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - if ( name === "tabIndex" ) { - var attributeNode = elem.getAttributeNode( "tabIndex" ); - - return attributeNode && attributeNode.specified ? - attributeNode.value : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - - return elem[ name ]; - } - - if ( !jQuery.support.style && notxml && name === "style" ) { - if ( set ) { - elem.style.cssText = "" + value; - } - - return elem.style.cssText; - } - - if ( set ) { - // convert the value to a string (all browsers do this but IE) see #1070 - elem.setAttribute( name, "" + value ); - } - - var attr = !jQuery.support.hrefNormalized && notxml && special ? - // Some attributes require a special call on IE - elem.getAttribute( name, 2 ) : - elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return attr === null ? undefined : attr; - } - - // elem is actually elem.style ... set the style - // Using attr for specific style information is now deprecated. Use style insead. - return jQuery.style( elem, name, value ); - } -}); -var fcleanup = function( nm ) { - return nm.replace(/[^\w\s\.\|`]/g, function( ch ) { - return "\\" + ch; - }); -}; - -/* - * A number of helper functions used for managing events. - * Many of the ideas behind this code originated from - * Dean Edwards' addEvent library. - */ -jQuery.event = { - - // Bind an event to an element - // Original by Dean Edwards - add: function( elem, types, handler, data ) { - /// - /// This method is internal. - /// - /// - - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // For whatever reason, IE has trouble passing the window object - // around, causing it to be cloned in the process - if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) { - elem = window; - } - - // Make sure that the function being executed has a unique ID - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // if data is passed, bind to handler - if ( data !== undefined ) { - // Create temporary function pointer to original handler - var fn = handler; - - // Create unique handler function, wrapped around original handler - handler = jQuery.proxy( fn ); - - // Store data in unique handler - handler.data = data; - } - - // Init the element's event structure - var events = jQuery.data( elem, "events" ) || jQuery.data( elem, "events", {} ), - handle = jQuery.data( elem, "handle" ), eventHandle; - - if ( !handle ) { - eventHandle = function() { - // Handle the second event of a trigger and when - // an event is called after a page has unloaded - return typeof jQuery !== "undefined" && !jQuery.event.triggered ? - jQuery.event.handle.apply( eventHandle.elem, arguments ) : - undefined; - }; - - handle = jQuery.data( elem, "handle", eventHandle ); - } - - // If no handle is found then we must be trying to bind to one of the - // banned noData elements - if ( !handle ) { - return; - } - - // Add elem as a property of the handle function - // This is to prevent a memory leak with non-native - // event in IE. - handle.elem = elem; - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = types.split( /\s+/ ); - - var type, i = 0; - - while ( (type = types[ i++ ]) ) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - - if ( i > 1 ) { - handler = jQuery.proxy( handler ); - - if ( data !== undefined ) { - handler.data = data; - } - } - - handler.type = namespaces.slice(0).sort().join("."); - - // Get the current list of functions bound to this event - var handlers = events[ type ], - special = this.special[ type ] || {}; - - // Init the event handler queue - if ( !handlers ) { - handlers = events[ type ] = {}; - - // Check for a special event handler - // Only use addEventListener/attachEvent if the special - // events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, handler) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, handle, false ); - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, handle ); - } - } - } - - if ( special.add ) { - var modifiedHandler = special.add.call( elem, handler, data, namespaces, handlers ); - if ( modifiedHandler && jQuery.isFunction( modifiedHandler ) ) { - modifiedHandler.guid = modifiedHandler.guid || handler.guid; - modifiedHandler.data = modifiedHandler.data || handler.data; - modifiedHandler.type = modifiedHandler.type || handler.type; - handler = modifiedHandler; - } - } - - // Add the function to the element's handler list - handlers[ handler.guid ] = handler; - - // Keep track of which events have been used, for global triggering - this.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler ) { - /// - /// This method is internal. - /// - /// - - // don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - var events = jQuery.data( elem, "events" ), ret, type, fn; - - if ( events ) { - // Unbind all events for the element - if ( types === undefined || (typeof types === "string" && types.charAt(0) === ".") ) { - for ( type in events ) { - this.remove( elem, type + (types || "") ); - } - } else { - // types is actually an event object here - if ( types.type ) { - handler = types.handler; - types = types.type; - } - - // Handle multiple events separated by a space - // jQuery(...).unbind("mouseover mouseout", fn); - types = types.split(/\s+/); - var i = 0; - while ( (type = types[ i++ ]) ) { - // Namespaced event handlers - var namespaces = type.split("."); - type = namespaces.shift(); - var all = !namespaces.length, - cleaned = jQuery.map( namespaces.slice(0).sort(), fcleanup ), - namespace = new RegExp("(^|\\.)" + cleaned.join("\\.(?:.*\\.)?") + "(\\.|$)"), - special = this.special[ type ] || {}; - - if ( events[ type ] ) { - // remove the given handler for the given type - if ( handler ) { - fn = events[ type ][ handler.guid ]; - delete events[ type ][ handler.guid ]; - - // remove all handlers for the given type - } else { - for ( var handle in events[ type ] ) { - // Handle the removal of namespaced events - if ( all || namespace.test( events[ type ][ handle ].type ) ) { - delete events[ type ][ handle ]; - } - } - } - - if ( special.remove ) { - special.remove.call( elem, namespaces, fn); - } - - // remove generic event handler if no more handlers exist - for ( ret in events[ type ] ) { - break; - } - if ( !ret ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, jQuery.data( elem, "handle" ), false ); - } else if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, jQuery.data( elem, "handle" ) ); - } - } - ret = null; - delete events[ type ]; - } - } - } - } - - // Remove the expando if it's no longer used - for ( ret in events ) { - break; - } - if ( !ret ) { - var handle = jQuery.data( elem, "handle" ); - if ( handle ) { - handle.elem = null; - } - jQuery.removeData( elem, "events" ); - jQuery.removeData( elem, "handle" ); - } - } - }, - - // bubbling is internal - trigger: function( event, data, elem /*, bubbling */ ) { - /// - /// This method is internal. - /// - /// - - // Event object or event type - var type = event.type || event, - bubbling = arguments[3]; - - if ( !bubbling ) { - event = typeof event === "object" ? - // jQuery.Event object - event[expando] ? event : - // Object literal - jQuery.extend( jQuery.Event(type), event ) : - // Just the event type (string) - jQuery.Event(type); - - if ( type.indexOf("!") >= 0 ) { - event.type = type = type.slice(0, -1); - event.exclusive = true; - } - - // Handle a global trigger - if ( !elem ) { - // Don't bubble custom events when global (to avoid too much overhead) - event.stopPropagation(); - - // Only trigger if we've ever bound an event for it - if ( this.global[ type ] ) { - jQuery.each( jQuery.cache, function() { - if ( this.events && this.events[type] ) { - jQuery.event.trigger( event, data, this.handle.elem ); - } - }); - } - } - - // Handle triggering a single element - - // don't do events on text and comment nodes - if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { - return undefined; - } - - // Clean up in case it is reused - event.result = undefined; - event.target = elem; - - // Clone the incoming data, if any - data = jQuery.makeArray( data ); - data.unshift( event ); - } - - event.currentTarget = elem; - - // Trigger the event, it is assumed that "handle" is a function - var handle = jQuery.data( elem, "handle" ); - if ( handle ) { - handle.apply( elem, data ); - } - - var parent = elem.parentNode || elem.ownerDocument; - - // Trigger an inline bound script - try { - if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { - if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { - event.result = false; - } - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (e) {} - - if ( !event.isPropagationStopped() && parent ) { - jQuery.event.trigger( event, data, parent, true ); - - } else if ( !event.isDefaultPrevented() ) { - var target = event.target, old, - isClick = jQuery.nodeName(target, "a") && type === "click"; - - if ( !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { - try { - if ( target[ type ] ) { - // Make sure that we don't accidentally re-trigger the onFOO events - old = target[ "on" + type ]; - - if ( old ) { - target[ "on" + type ] = null; - } - - this.triggered = true; - target[ type ](); - } - - // prevent IE from throwing an error for some elements with some event types, see #3533 - } catch (e) {} - - if ( old ) { - target[ "on" + type ] = old; - } - - this.triggered = false; - } - } - }, - - handle: function( event ) { - /// - /// This method is internal. - /// - /// - - // returned undefined or false - var all, handlers; - - event = arguments[0] = jQuery.event.fix( event || window.event ); - event.currentTarget = this; - - // Namespaced event handlers - var namespaces = event.type.split("."); - event.type = namespaces.shift(); - - // Cache this now, all = true means, any handler - all = !namespaces.length && !event.exclusive; - - var namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)"); - - handlers = ( jQuery.data(this, "events") || {} )[ event.type ]; - - for ( var j in handlers ) { - var handler = handlers[ j ]; - - // Filter the functions by class - if ( all || namespace.test(handler.type) ) { - // Pass in a reference to the handler function itself - // So that we can later remove it - event.handler = handler; - event.data = handler.data; - - var ret = handler.apply( this, arguments ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - - if ( event.isImmediatePropagationStopped() ) { - break; - } - - } - } - - return event.result; - }, - - props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), - - fix: function( event ) { - /// - /// This method is internal. - /// - /// - - if ( event[ expando ] ) { - return event; - } - - // store a copy of the original event object - // and "clone" to set read-only properties - var originalEvent = event; - event = jQuery.Event( originalEvent ); - - for ( var i = this.props.length, prop; i; ) { - prop = this.props[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary - if ( !event.target ) { - event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either - } - - // check if target is a textnode (safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && event.fromElement ) { - event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; - } - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && event.clientX != null ) { - var doc = document.documentElement, body = document.body; - event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); - event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add which for key events - if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) { - event.which = event.charCode || event.keyCode; - } - - // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) - if ( !event.metaKey && event.ctrlKey ) { - event.metaKey = event.ctrlKey; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && event.button !== undefined ) { - event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); - } - - return event; - }, - - // Deprecated, use jQuery.guid instead - guid: 1E8, - - // Deprecated, use jQuery.proxy instead - proxy: jQuery.proxy, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady, - teardown: jQuery.noop - }, - - live: { - add: function( proxy, data, namespaces, live ) { - jQuery.extend( proxy, data || {} ); - - proxy.guid += data.selector + data.live; - data.liveProxy = proxy; - - jQuery.event.add( this, data.live, liveHandler, data ); - - }, - - remove: function( namespaces ) { - if ( namespaces.length ) { - var remove = 0, name = new RegExp("(^|\\.)" + namespaces[0] + "(\\.|$)"); - - jQuery.each( (jQuery.data(this, "events").live || {}), function() { - if ( name.test(this.type) ) { - remove++; - } - }); - - if ( remove < 1 ) { - jQuery.event.remove( this, namespaces[0], liveHandler ); - } - } - }, - special: {} - }, - beforeunload: { - setup: function( data, namespaces, fn ) { - // We only want to do this special case on windows - if ( this.setInterval ) { - this.onbeforeunload = fn; - } - - return false; - }, - teardown: function( namespaces, fn ) { - if ( this.onbeforeunload === fn ) { - this.onbeforeunload = null; - } - } - } - } -}; - -jQuery.Event = function( src ) { - // Allow instantiation without the 'new' keyword - if ( !this.preventDefault ) { - return new jQuery.Event( src ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - // Event type - } else { - this.type = src; - } - - // timeStamp is buggy for some events on Firefox(#3843) - // So we won't rely on the native value - this.timeStamp = now(); - - // Mark it as fixed - this[ expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - } - // otherwise set the returnValue property of the original event to false (IE) - e.returnValue = false; - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Checks if an event happened on an element within another element -// Used in jQuery.event.special.mouseenter and mouseleave handlers -var withinElement = function( event ) { - // Check if mouse(over|out) are still within the same parent element - var parent = event.relatedTarget; - - // Traverse up the tree - while ( parent && parent !== this ) { - // Firefox sometimes assigns relatedTarget a XUL element - // which we cannot access the parentNode property of - try { - parent = parent.parentNode; - - // assuming we've left the element since we most likely mousedover a xul element - } catch(e) { - break; - } - } - - if ( parent !== this ) { - // set the correct event type - event.type = event.data; - - // handle event if we actually just moused on to a non sub-element - jQuery.event.handle.apply( this, arguments ); - } - -}, - -// In case of event delegation, we only need to rename the event.type, -// liveHandler will take care of the rest. -delegate = function( event ) { - event.type = event.data; - jQuery.event.handle.apply( this, arguments ); -}; - -// Create mouseenter and mouseleave events -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - setup: function( data ) { - jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); - }, - teardown: function( data ) { - jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); - } - }; -}); - -// submit delegation -if ( !jQuery.support.submitBubbles ) { - -jQuery.event.special.submit = { - setup: function( data, namespaces, fn ) { - if ( this.nodeName.toLowerCase() !== "form" ) { - jQuery.event.add(this, "click.specialSubmit." + fn.guid, function( e ) { - var elem = e.target, type = elem.type; - - if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { - return trigger( "submit", this, arguments ); - } - }); - - jQuery.event.add(this, "keypress.specialSubmit." + fn.guid, function( e ) { - var elem = e.target, type = elem.type; - - if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { - return trigger( "submit", this, arguments ); - } - }); - - } else { - return false; - } - }, - - remove: function( namespaces, fn ) { - jQuery.event.remove( this, "click.specialSubmit" + (fn ? "."+fn.guid : "") ); - jQuery.event.remove( this, "keypress.specialSubmit" + (fn ? "."+fn.guid : "") ); - } -}; - -} - -// change delegation, happens here so we have bind. -if ( !jQuery.support.changeBubbles ) { - -var formElems = /textarea|input|select/i; - -function getVal( elem ) { - var type = elem.type, val = elem.value; - - if ( type === "radio" || type === "checkbox" ) { - val = elem.checked; - - } else if ( type === "select-multiple" ) { - val = elem.selectedIndex > -1 ? - jQuery.map( elem.options, function( elem ) { - return elem.selected; - }).join("-") : - ""; - - } else if ( elem.nodeName.toLowerCase() === "select" ) { - val = elem.selectedIndex; - } - - return val; -} - -function testChange( e ) { - var elem = e.target, data, val; - - if ( !formElems.test( elem.nodeName ) || elem.readOnly ) { - return; - } - - data = jQuery.data( elem, "_change_data" ); - val = getVal(elem); - - // the current data will be also retrieved by beforeactivate - if ( e.type !== "focusout" || elem.type !== "radio" ) { - jQuery.data( elem, "_change_data", val ); - } - - if ( data === undefined || val === data ) { - return; - } - - if ( data != null || val ) { - e.type = "change"; - return jQuery.event.trigger( e, arguments[1], elem ); - } -} - -jQuery.event.special.change = { - filters: { - focusout: testChange, - - click: function( e ) { - var elem = e.target, type = elem.type; - - if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { - return testChange.call( this, e ); - } - }, - - // Change has to be called before submit - // Keydown will be called before keypress, which is used in submit-event delegation - keydown: function( e ) { - var elem = e.target, type = elem.type; - - if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || - (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || - type === "select-multiple" ) { - return testChange.call( this, e ); - } - }, - - // Beforeactivate happens also before the previous element is blurred - // with this event you can't trigger a change event, but you can store - // information/focus[in] is not needed anymore - beforeactivate: function( e ) { - var elem = e.target; - - if ( elem.nodeName.toLowerCase() === "input" && elem.type === "radio" ) { - jQuery.data( elem, "_change_data", getVal(elem) ); - } - } - }, - setup: function( data, namespaces, fn ) { - for ( var type in changeFilters ) { - jQuery.event.add( this, type + ".specialChange." + fn.guid, changeFilters[type] ); - } - - return formElems.test( this.nodeName ); - }, - remove: function( namespaces, fn ) { - for ( var type in changeFilters ) { - jQuery.event.remove( this, type + ".specialChange" + (fn ? "."+fn.guid : ""), changeFilters[type] ); - } - - return formElems.test( this.nodeName ); - } -}; - -var changeFilters = jQuery.event.special.change.filters; - -} - -function trigger( type, elem, args ) { - args[0].type = type; - return jQuery.event.handle.apply( elem, args ); -} - -// Create "bubbling" focus and blur events -if ( document.addEventListener ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - jQuery.event.special[ fix ] = { - setup: function() { - /// - /// This method is internal. - /// - /// - - this.addEventListener( orig, handler, true ); - }, - teardown: function() { - /// - /// This method is internal. - /// - /// - - this.removeEventListener( orig, handler, true ); - } - }; - - function handler( e ) { - e = jQuery.event.fix( e ); - e.type = fix; - return jQuery.event.handle.call( this, e ); - } - }); -} - -// jQuery.each(["bind", "one"], function( i, name ) { -// jQuery.fn[ name ] = function( type, data, fn ) { -// // Handle object literals -// if ( typeof type === "object" ) { -// for ( var key in type ) { -// this[ name ](key, data, type[key], fn); -// } -// return this; -// } -// -// if ( jQuery.isFunction( data ) ) { -// fn = data; -// data = undefined; -// } -// -// var handler = name === "one" ? jQuery.proxy( fn, function( event ) { -// jQuery( this ).unbind( event, handler ); -// return fn.apply( this, arguments ); -// }) : fn; -// -// return type === "unload" && name !== "one" ? -// this.one( type, data, fn ) : -// this.each(function() { -// jQuery.event.add( this, type, handler, data ); -// }); -// }; -// }); - -jQuery.fn[ "bind" ] = function( type, data, fn ) { - /// - /// Binds a handler to one or more events for each matched element. Can also bind custom events. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as event.data - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ "bind" ](key, data, type[key], fn); - } - return this; - } - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - var handler = "bind" === "one" ? jQuery.proxy( fn, function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }) : fn; - - return type === "unload" && "bind" !== "one" ? - this.one( type, data, fn ) : - this.each(function() { - jQuery.event.add( this, type, handler, data ); - }); -}; - -jQuery.fn[ "one" ] = function( type, data, fn ) { - /// - /// Binds a handler to one or more events to be executed exactly once for each matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as event.data - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if ( typeof type === "object" ) { - for ( var key in type ) { - this[ "one" ](key, data, type[key], fn); - } - return this; - } - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - var handler = "one" === "one" ? jQuery.proxy( fn, function( event ) { - jQuery( this ).unbind( event, handler ); - return fn.apply( this, arguments ); - }) : fn; - - return type === "unload" && "one" !== "one" ? - this.one( type, data, fn ) : - this.each(function() { - jQuery.event.add( this, type, handler, data ); - }); -}; - -jQuery.fn.extend({ - unbind: function( type, fn ) { - /// - /// Unbinds a handler from one or more events for each matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. - - // Handle object literals - if ( typeof type === "object" && !type.preventDefault ) { - for ( var key in type ) { - this.unbind(key, type[key]); - } - return this; - } - - return this.each(function() { - jQuery.event.remove( this, type, fn ); - }); - }, - trigger: function( type, data ) { - /// - /// Triggers a type of event on every matched element. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as additional arguments. - /// This parameter is undocumented. - - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - - triggerHandler: function( type, data ) { - /// - /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. - /// - /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . - /// Additional data passed to the event handler as additional arguments. - /// This parameter is undocumented. - - if ( this[0] ) { - var event = jQuery.Event( type ); - event.preventDefault(); - event.stopPropagation(); - jQuery.event.trigger( event, data, this[0] ); - return event.result; - } - }, - - toggle: function( fn ) { - /// - /// Toggles among two or more function calls every other click. - /// - /// The functions among which to toggle execution - - // Save reference to arguments for access in closure - var args = arguments, i = 1; - - // link all the functions, so any of them can unbind this click handler - while ( i < args.length ) { - jQuery.proxy( fn, args[ i++ ] ); - } - - return this.click( jQuery.proxy( fn, function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - })); - }, - - hover: function( fnOver, fnOut ) { - /// - /// Simulates hovering (moving the mouse on or off of an object). - /// - /// The function to fire when the mouse is moved over a matched element. - /// The function to fire when the mouse is moved off of a matched element. - - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -// jQuery.each(["live", "die"], function( i, name ) { -// jQuery.fn[ name ] = function( types, data, fn ) { -// var type, i = 0; -// -// if ( jQuery.isFunction( data ) ) { -// fn = data; -// data = undefined; -// } -// -// types = (types || "").split( /\s+/ ); -// -// while ( (type = types[ i++ ]) != null ) { -// type = type === "focus" ? "focusin" : // focus --> focusin -// type === "blur" ? "focusout" : // blur --> focusout -// type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support -// type; -// -// if ( name === "live" ) { -// // bind live handler -// jQuery( this.context ).bind( liveConvert( type, this.selector ), { -// data: data, selector: this.selector, live: type -// }, fn ); -// -// } else { -// // unbind live handler -// jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); -// } -// } -// -// return this; -// } -// }); - -jQuery.fn[ "live" ] = function( types, data, fn ) { - /// - /// Attach a handler to the event for all elements which match the current selector, now or - /// in the future. - /// - /// - /// A string containing a JavaScript event type, such as "click" or "keydown". - /// - /// - /// A map of data that will be passed to the event handler. - /// - /// - /// A function to execute at the time the event is triggered. - /// - /// - - var type, i = 0; - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - types = (types || "").split( /\s+/ ); - - while ( (type = types[ i++ ]) != null ) { - type = type === "focus" ? "focusin" : // focus --> focusin - type === "blur" ? "focusout" : // blur --> focusout - type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support - type; - - if ( "live" === "live" ) { - // bind live handler - jQuery( this.context ).bind( liveConvert( type, this.selector ), { - data: data, selector: this.selector, live: type - }, fn ); - - } else { - // unbind live handler - jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); - } - } - - return this; -} - -jQuery.fn[ "die" ] = function( types, data, fn ) { - /// - /// Remove all event handlers previously attached using .live() from the elements. - /// - /// - /// A string containing a JavaScript event type, such as click or keydown. - /// - /// - /// The function that is to be no longer executed. - /// - /// - - var type, i = 0; - - if ( jQuery.isFunction( data ) ) { - fn = data; - data = undefined; - } - - types = (types || "").split( /\s+/ ); - - while ( (type = types[ i++ ]) != null ) { - type = type === "focus" ? "focusin" : // focus --> focusin - type === "blur" ? "focusout" : // blur --> focusout - type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support - type; - - if ( "die" === "live" ) { - // bind live handler - jQuery( this.context ).bind( liveConvert( type, this.selector ), { - data: data, selector: this.selector, live: type - }, fn ); - - } else { - // unbind live handler - jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); - } - } - - return this; -} - -function liveHandler( event ) { - var stop, elems = [], selectors = [], args = arguments, - related, match, fn, elem, j, i, l, data, - live = jQuery.extend({}, jQuery.data( this, "events" ).live); - - // Make sure we avoid non-left-click bubbling in Firefox (#3861) - if ( event.button && event.type === "click" ) { - return; - } - - for ( j in live ) { - fn = live[j]; - if ( fn.live === event.type || - fn.altLive && jQuery.inArray(event.type, fn.altLive) > -1 ) { - - data = fn.data; - if ( !(data.beforeFilter && data.beforeFilter[event.type] && - !data.beforeFilter[event.type](event)) ) { - selectors.push( fn.selector ); - } - } else { - delete live[j]; - } - } - - match = jQuery( event.target ).closest( selectors, event.currentTarget ); - - for ( i = 0, l = match.length; i < l; i++ ) { - for ( j in live ) { - fn = live[j]; - elem = match[i].elem; - related = null; - - if ( match[i].selector === fn.selector ) { - // Those two events require additional checking - if ( fn.live === "mouseenter" || fn.live === "mouseleave" ) { - related = jQuery( event.relatedTarget ).closest( fn.selector )[0]; - } - - if ( !related || related !== elem ) { - elems.push({ elem: elem, fn: fn }); - } - } - } - } - - for ( i = 0, l = elems.length; i < l; i++ ) { - match = elems[i]; - event.currentTarget = match.elem; - event.data = match.fn.data; - if ( match.fn.apply( match.elem, args ) === false ) { - stop = false; - break; - } - } - - return stop; -} - -function liveConvert( type, selector ) { - return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); -} - -// jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + -// "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + -// "change select submit keydown keypress keyup error").split(" "), function( i, name ) { -// -// // Handle event binding -// jQuery.fn[ name ] = function( fn ) { -// return fn ? this.bind( name, fn ) : this.trigger( name ); -// }; -// -// if ( jQuery.attrFn ) { -// jQuery.attrFn[ name ] = true; -// } -// }); - -jQuery.fn[ "blur" ] = function( fn ) { - /// - /// 1: blur() - Triggers the blur event of each matched element. - /// 2: blur(fn) - Binds a function to the blur event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "blur", fn ) : this.trigger( "blur" ); -}; - -jQuery.fn[ "focus" ] = function( fn ) { - /// - /// 1: focus() - Triggers the focus event of each matched element. - /// 2: focus(fn) - Binds a function to the focus event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "focus", fn ) : this.trigger( "focus" ); -}; - -jQuery.fn[ "focusin" ] = function( fn ) { - /// - /// Bind an event handler to the "focusin" JavaScript event. - /// - /// - /// A function to execute each time the event is triggered. - /// - /// - - return fn ? this.bind( "focusin", fn ) : this.trigger( "focusin" ); -}; - -jQuery.fn[ "focusout" ] = function( fn ) { - /// - /// Bind an event handler to the "focusout" JavaScript event. - /// - /// - /// A function to execute each time the event is triggered. - /// - /// - - return fn ? this.bind( "focusout", fn ) : this.trigger( "focusout" ); -}; - -jQuery.fn[ "load" ] = function( fn ) { - /// - /// 1: load() - Triggers the load event of each matched element. - /// 2: load(fn) - Binds a function to the load event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "load", fn ) : this.trigger( "load" ); -}; - -jQuery.fn[ "resize" ] = function( fn ) { - /// - /// 1: resize() - Triggers the resize event of each matched element. - /// 2: resize(fn) - Binds a function to the resize event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "resize", fn ) : this.trigger( "resize" ); -}; - -jQuery.fn[ "scroll" ] = function( fn ) { - /// - /// 1: scroll() - Triggers the scroll event of each matched element. - /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "scroll", fn ) : this.trigger( "scroll" ); -}; - -jQuery.fn[ "unload" ] = function( fn ) { - /// - /// 1: unload() - Triggers the unload event of each matched element. - /// 2: unload(fn) - Binds a function to the unload event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "unload", fn ) : this.trigger( "unload" ); -}; - -jQuery.fn[ "click" ] = function( fn ) { - /// - /// 1: click() - Triggers the click event of each matched element. - /// 2: click(fn) - Binds a function to the click event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "click", fn ) : this.trigger( "click" ); -}; - -jQuery.fn[ "dblclick" ] = function( fn ) { - /// - /// 1: dblclick() - Triggers the dblclick event of each matched element. - /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "dblclick", fn ) : this.trigger( "dblclick" ); -}; - -jQuery.fn[ "mousedown" ] = function( fn ) { - /// - /// Binds a function to the mousedown event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mousedown", fn ) : this.trigger( "mousedown" ); -}; - -jQuery.fn[ "mouseup" ] = function( fn ) { - /// - /// Bind a function to the mouseup event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mouseup", fn ) : this.trigger( "mouseup" ); -}; - -jQuery.fn[ "mousemove" ] = function( fn ) { - /// - /// Bind a function to the mousemove event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mousemove", fn ) : this.trigger( "mousemove" ); -}; - -jQuery.fn[ "mouseover" ] = function( fn ) { - /// - /// Bind a function to the mouseover event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mouseover", fn ) : this.trigger( "mouseover" ); -}; - -jQuery.fn[ "mouseout" ] = function( fn ) { - /// - /// Bind a function to the mouseout event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mouseout", fn ) : this.trigger( "mouseout" ); -}; - -jQuery.fn[ "mouseenter" ] = function( fn ) { - /// - /// Bind a function to the mouseenter event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mouseenter", fn ) : this.trigger( "mouseenter" ); -}; - -jQuery.fn[ "mouseleave" ] = function( fn ) { - /// - /// Bind a function to the mouseleave event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "mouseleave", fn ) : this.trigger( "mouseleave" ); -}; - -jQuery.fn[ "change" ] = function( fn ) { - /// - /// 1: change() - Triggers the change event of each matched element. - /// 2: change(fn) - Binds a function to the change event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "change", fn ) : this.trigger( "change" ); -}; - -jQuery.fn[ "select" ] = function( fn ) { - /// - /// 1: select() - Triggers the select event of each matched element. - /// 2: select(fn) - Binds a function to the select event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "select", fn ) : this.trigger( "select" ); -}; - -jQuery.fn[ "submit" ] = function( fn ) { - /// - /// 1: submit() - Triggers the submit event of each matched element. - /// 2: submit(fn) - Binds a function to the submit event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "submit", fn ) : this.trigger( "submit" ); -}; - -jQuery.fn[ "keydown" ] = function( fn ) { - /// - /// 1: keydown() - Triggers the keydown event of each matched element. - /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "keydown", fn ) : this.trigger( "keydown" ); -}; - -jQuery.fn[ "keypress" ] = function( fn ) { - /// - /// 1: keypress() - Triggers the keypress event of each matched element. - /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "keypress", fn ) : this.trigger( "keypress" ); -}; - -jQuery.fn[ "keyup" ] = function( fn ) { - /// - /// 1: keyup() - Triggers the keyup event of each matched element. - /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "keyup", fn ) : this.trigger( "keyup" ); -}; - -jQuery.fn[ "error" ] = function( fn ) { - /// - /// 1: error() - Triggers the error event of each matched element. - /// 2: error(fn) - Binds a function to the error event of each matched element. - /// - /// The function to execute. - /// - - return fn ? this.bind( "error", fn ) : this.trigger( "error" ); -}; - -// Prevent memory leaks in IE -// Window isn't included so as not to unbind existing unload events -// More info: -// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ -if ( window.attachEvent && !window.addEventListener ) { - window.attachEvent("onunload", function() { - for ( var id in jQuery.cache ) { - if ( jQuery.cache[ id ].handle ) { - // Try/Catch is to handle iframes being unloaded, see #4280 - try { - jQuery.event.remove( jQuery.cache[ id ].handle.elem ); - } catch(e) {} - } - } - }); -} -/*! - * Sizzle CSS Selector Engine - v1.0 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function(){ - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function(selector, context, results, seed) { - results = results || []; - var origContext = context = context || document; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context), - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context ); - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set ); - } - } - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - var ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0]; - } - - if ( context ) { - var ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray(set); - } else { - prune = false; - } - - while ( parts.length ) { - var cur = parts.pop(), pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - } else if ( context && context.nodeType === 1 ) { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - } else { - for ( var i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function(results){ - /// - /// Removes all duplicate elements from an array of elements. - /// - /// The array to translate - /// The array after translation. - - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort(sortOrder); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[i-1] ) { - results.splice(i--, 1); - } - } - } - } - - return results; -}; - -Sizzle.matches = function(expr, set){ - return Sizzle(expr, null, null, set); -}; - -Sizzle.find = function(expr, context, isXML){ - var set, match; - - if ( !expr ) { - return []; - } - - for ( var i = 0, l = Expr.order.length; i < l; i++ ) { - var type = Expr.order[i], match; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - var left = match[1]; - match.splice(1,1); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace(/\\/g, ""); - set = Expr.find[ type ]( match, context, isXML ); - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = context.getElementsByTagName("*"); - } - - return {set: set, expr: expr}; -}; - -Sizzle.filter = function(expr, set, inplace, not){ - var old = expr, result = [], curLoop = set, match, anyFound, - isXMLFilter = set && set[0] && isXML(set[0]); - - while ( expr && set.length ) { - for ( var type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - var filter = Expr.filter[ type ], found, item, left = match[1]; - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( var i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - var pass = not ^ !!found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - } else { - curLoop[i] = false; - } - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - match: { - ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - leftMatch: {}, - attrMap: { - "class": "className", - "for": "htmlFor" - }, - attrHandle: { - href: function(elem){ - return elem.getAttribute("href"); - } - }, - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !/\W/.test(part), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - ">": function(checkSet, part){ - var isPartStr = typeof part === "string"; - - if ( isPartStr && !/\W/.test(part) ) { - part = part.toLowerCase(); - - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - } else { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - "": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - var nodeCheck = part = part.toLowerCase(); - checkFn = dirNodeCheck; - } - - checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML); - }, - "~": function(checkSet, part, isXML){ - var doneName = done++, checkFn = dirCheck; - - if ( typeof part === "string" && !/\W/.test(part) ) { - var nodeCheck = part = part.toLowerCase(); - checkFn = dirNodeCheck; - } - - checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML); - } - }, - find: { - ID: function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? [m] : []; - } - }, - NAME: function(match, context){ - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], results = context.getElementsByName(match[1]); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - TAG: function(match, context){ - return context.getElementsByTagName(match[1]); - } - }, - preFilter: { - CLASS: function(match, curLoop, inplace, result, not, isXML){ - match = " " + match[1].replace(/\\/g, "") + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - ID: function(match){ - return match[1].replace(/\\/g, ""); - }, - TAG: function(match, curLoop){ - return match[1].toLowerCase(); - }, - CHILD: function(match){ - if ( match[1] === "nth" ) { - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - ATTR: function(match, curLoop, inplace, result, not, isXML){ - var name = match[1].replace(/\\/g, ""); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - PSEUDO: function(match, curLoop, inplace, result, not){ - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - if ( !inplace ) { - result.push.apply( result, ret ); - } - return false; - } - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - POS: function(match){ - match.unshift( true ); - return match; - } - }, - filters: { - enabled: function(elem){ - return elem.disabled === false && elem.type !== "hidden"; - }, - disabled: function(elem){ - return elem.disabled === true; - }, - checked: function(elem){ - return elem.checked === true; - }, - selected: function(elem){ - // Accessing this property makes selected-by-default - // options in Safari work properly - elem.parentNode.selectedIndex; - return elem.selected === true; - }, - parent: function(elem){ - return !!elem.firstChild; - }, - empty: function(elem){ - return !elem.firstChild; - }, - has: function(elem, i, match){ - /// - /// Internal use only; use hasClass('class') - /// - /// - - return !!Sizzle( match[3], elem ).length; - }, - header: function(elem){ - return /h\d/i.test( elem.nodeName ); - }, - text: function(elem){ - return "text" === elem.type; - }, - radio: function(elem){ - return "radio" === elem.type; - }, - checkbox: function(elem){ - return "checkbox" === elem.type; - }, - file: function(elem){ - return "file" === elem.type; - }, - password: function(elem){ - return "password" === elem.type; - }, - submit: function(elem){ - return "submit" === elem.type; - }, - image: function(elem){ - return "image" === elem.type; - }, - reset: function(elem){ - return "reset" === elem.type; - }, - button: function(elem){ - return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; - }, - input: function(elem){ - return /input|select|textarea|button/i.test(elem.nodeName); - } - }, - setFilters: { - first: function(elem, i){ - return i === 0; - }, - last: function(elem, i, match, array){ - return i === array.length - 1; - }, - even: function(elem, i){ - return i % 2 === 0; - }, - odd: function(elem, i){ - return i % 2 === 1; - }, - lt: function(elem, i, match){ - return i < match[3] - 0; - }, - gt: function(elem, i, match){ - return i > match[3] - 0; - }, - nth: function(elem, i, match){ - return match[3] - 0 === i; - }, - eq: function(elem, i, match){ - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function(elem, match, i, array){ - var name = match[1], filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - } else if ( name === "not" ) { - var not = match[3]; - - for ( var i = 0, l = not.length; i < l; i++ ) { - if ( not[i] === elem ) { - return false; - } - } - - return true; - } else { - Sizzle.error( "Syntax error, unrecognized expression: " + name ); - } - }, - CHILD: function(elem, match){ - var type = match[1], node = elem; - switch (type) { - case 'only': - case 'first': - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - if ( type === "first" ) { - return true; - } - node = elem; - case 'last': - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - return true; - case 'nth': - var first = match[2], last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - var doneName = match[0], - parent = elem.parentNode; - - if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { - var count = 0; - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - parent.sizcache = doneName; - } - - var diff = elem.nodeIndex - last; - if ( first === 0 ) { - return diff === 0; - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - ID: function(elem, match){ - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - TAG: function(elem, match){ - return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; - }, - CLASS: function(elem, match){ - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - ATTR: function(elem, match){ - var name = match[1], - result = Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - POS: function(elem, match, i, array){ - var name = match[2], filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){ - return "\\" + (num - 0 + 1); - })); -} - -var makeArray = function(array, results) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 ); - -// Provide a fallback method if it does not work -} catch(e){ - makeArray = function(array, results) { - var ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - } else { - if ( typeof array.length === "number" ) { - for ( var i = 0, l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - } else { - for ( var i = 0; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.compareDocumentPosition ? -1 : 1; - } - - var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( "sourceIndex" in document.documentElement ) { - sortOrder = function( a, b ) { - if ( !a.sourceIndex || !b.sourceIndex ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.sourceIndex ? -1 : 1; - } - - var ret = a.sourceIndex - b.sourceIndex; - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} else if ( document.createRange ) { - sortOrder = function( a, b ) { - if ( !a.ownerDocument || !b.ownerDocument ) { - if ( a == b ) { - hasDuplicate = true; - } - return a.ownerDocument ? -1 : 1; - } - - var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange(); - aRange.setStart(a, 0); - aRange.setEnd(a, 0); - bRange.setStart(b, 0); - bRange.setEnd(b, 0); - var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange); - if ( ret === 0 ) { - hasDuplicate = true; - } - return ret; - }; -} - -// Utility function for retreiving the text value of an array of DOM nodes -function getText( elems ) { - var ret = "", elem; - - for ( var i = 0; elems[i]; i++ ) { - elem = elems[i]; - - // Get the text from text nodes and CDATA nodes - if ( elem.nodeType === 3 || elem.nodeType === 4 ) { - ret += elem.nodeValue; - - // Traverse everything else, except comment nodes - } else if ( elem.nodeType !== 8 ) { - ret += getText( elem.childNodes ); - } - } - - return ret; -} - -// [vsdoc] The following function has been modified for IntelliSense. -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - // var form = document.createElement("div"), - // id = "script" + (new Date).getTime(); - // form.innerHTML = ""; - - // // Inject it into the root element, check its status, and remove it quickly - // var root = document.documentElement; - // root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - // if ( document.getElementById( id ) ) { - Expr.find.ID = function(match, context, isXML){ - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : []; - } - }; - - Expr.filter.ID = function(elem, match){ - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - // } - - // root.removeChild( form ); - root = form = null; // release memory in IE -})(); - -// [vsdoc] The following function has been modified for IntelliSense. -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - // var div = document.createElement("div"); - // div.appendChild( document.createComment("") ); - - // Make sure no comments are found - // if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function(match, context){ - var results = context.getElementsByTagName(match[1]); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - // } - - // Check to see if an attribute returns normalized href attributes - // div.innerHTML = ""; - // if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - // div.firstChild.getAttribute("href") !== "#" ) { - Expr.attrHandle.href = function(elem){ - return elem.getAttribute("href", 2); - }; - // } - - div = null; // release memory in IE -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, div = document.createElement("div"); - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function(query, context, extra, seed){ - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && context.nodeType === 9 && !isXML(context) ) { - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(e){} - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - div = null; // release memory in IE - })(); -} - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function(match, context, isXML) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - div = null; // release memory in IE -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem.sizcache = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - if ( elem ) { - elem = elem[dir]; - var match = false; - - while ( elem ) { - if ( elem.sizcache === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem.sizcache = doneName; - elem.sizset = i; - } - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -var contains = document.compareDocumentPosition ? function(a, b){ - /// - /// Check to see if a DOM node is within another DOM node. - /// - /// - /// The DOM element that may contain the other element. - /// - /// - /// The DOM node that may be contained by the other element. - /// - /// - - return a.compareDocumentPosition(b) & 16; -} : function(a, b){ - /// - /// Check to see if a DOM node is within another DOM node. - /// - /// - /// The DOM element that may contain the other element. - /// - /// - /// The DOM node that may be contained by the other element. - /// - /// - - return a !== b && (a.contains ? a.contains(b) : true); -}; - -var isXML = function(elem){ - /// - /// Determines if the parameter passed is an XML document. - /// - /// The object to test - /// True if the parameter is an XML document; otherwise false. - - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function(selector, context){ - var tmpSet = [], later = "", match, - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.getText = getText; -jQuery.isXMLDoc = isXML; -jQuery.contains = contains; - -return; - -window.Sizzle = Sizzle; - -})(); -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - slice = Array.prototype.slice; - -// Implement the identical functionality for filter and not -var winnow = function( elements, qualifier, keep ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - return !!qualifier.call( elem, i, elem ) === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return (elem === qualifier) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return (jQuery.inArray( elem, qualifier ) >= 0) === keep; - }); -}; - -jQuery.fn.extend({ - find: function( selector ) { - /// - /// Searches for all elements that match the specified expression. - /// This method is a good way to find additional descendant - /// elements with which to process. - /// All searching is done using a jQuery expression. The expression can be - /// written using CSS 1-3 Selector syntax, or basic XPath. - /// Part of DOM/Traversing - /// - /// - /// - /// An expression to search with. - /// - /// - - var ret = this.pushStack( "", "find", selector ), length = 0; - - for ( var i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( var n = length; n < ret.length; n++ ) { - for ( var r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - /// - /// Reduce the set of matched elements to those that have a descendant that matches the - /// selector or DOM element. - /// - /// - /// A string containing a selector expression to match elements against. - /// - /// - - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - /// - /// Removes any elements inside the array of elements from the set - /// of matched elements. This method is used to remove one or more - /// elements from a jQuery object. - /// Part of DOM/Traversing - /// - /// - /// A set of elements to remove from the jQuery set of matched elements. - /// - /// - - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - /// - /// Removes all elements from the set of matched elements that do not - /// pass the specified filter. This method is used to narrow down - /// the results of a search. - /// }) - /// Part of DOM/Traversing - /// - /// - /// - /// A function to use for filtering - /// - /// - - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - /// - /// Checks the current selection against an expression and returns true, - /// if at least one element of the selection fits the given expression. - /// Does return false, if no element fits or the expression is not valid. - /// filter(String) is used internally, therefore all rules that apply there - /// apply here, too. - /// Part of DOM/Traversing - /// - /// - /// - /// The expression with which to filter - /// - - return !!selector && jQuery.filter( selector, this ).length > 0; - }, - - closest: function( selectors, context ) { - /// - /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. - /// - /// - /// A string containing a selector expression to match elements against. - /// - /// - /// A DOM element within which a matching element may be found. If no context is passed - /// in then the context of the jQuery set will be used instead. - /// - /// - - if ( jQuery.isArray( selectors ) ) { - var ret = [], cur = this[0], match, matches = {}, selector; - - if ( cur && selectors.length ) { - for ( var i = 0, l = selectors.length; i < l; i++ ) { - selector = selectors[i]; - - if ( !matches[selector] ) { - matches[selector] = jQuery.expr.match.POS.test( selector ) ? - jQuery( selector, context || this.context ) : - selector; - } - } - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( selector in matches ) { - match = matches[selector]; - - if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { - ret.push({ selector: selector, elem: cur }); - delete matches[selector]; - } - } - cur = cur.parentNode; - } - } - - return ret; - } - - var pos = jQuery.expr.match.POS.test( selectors ) ? - jQuery( selectors, context || this.context ) : null; - - return this.map(function( i, cur ) { - while ( cur && cur.ownerDocument && cur !== context ) { - if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) { - return cur; - } - cur = cur.parentNode; - } - return null; - }); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - /// - /// Searches every matched element for the object and returns - /// the index of the element, if found, starting with zero. - /// Returns -1 if the object wasn't found. - /// Part of Core - /// - /// - /// - /// Object to search for - /// - - if ( !elem || typeof elem === "string" ) { - return jQuery.inArray( this[0], - // If it receives a string, the selector is used - // If it receives nothing, the siblings are used - elem ? jQuery( elem ) : this.parent().children() ); - } - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - /// - /// Adds one or more Elements to the set of matched elements. - /// Part of DOM/Traversing - /// - /// - /// A string containing a selector expression to match additional elements against. - /// - /// - /// Add some elements rooted against the specified context. - /// - /// - - var set = typeof selector === "string" ? - jQuery( selector, context || this.context ) : - jQuery.makeArray( selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - /// - /// Adds the previous selection to the current selection. - /// - /// - - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, slice.call(arguments).join(",") ); - }; -}); - -jQuery.fn[ "parentsUntil" ] = function( until, selector ) { - /// - /// Get the ancestors of each element in the current set of matched elements, up to but not - /// including the element matched by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching ancestor - /// elements. - /// - /// - - var fn = function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - } - - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( "parentsUntil" ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( "parentsUntil" ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, "parentsUntil", slice.call(arguments).join(",") ); -}; - -jQuery.fn[ "nextUntil" ] = function( until, selector ) { - /// - /// Get all following siblings of each element up to but not including the element matched - /// by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching following - /// sibling elements. - /// - /// - - var fn = function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - } - - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( "nextUntil" ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( "nextUntil" ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, "nextUntil", slice.call(arguments).join(",") ); -}; - -jQuery.fn[ "prevUntil" ] = function( until, selector ) { - /// - /// Get all preceding siblings of each element up to but not including the element matched - /// by the selector. - /// - /// - /// A string containing a selector expression to indicate where to stop matching preceding - /// sibling elements. - /// - /// - - var fn = function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - } - - var ret = jQuery.map( this, fn, until ); - - if ( !runtil.test( "prevUntil" ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( "prevUntil" ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, "prevUntil", slice.call(arguments).join(",") ); -}; - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - /// - /// This member is internal only. - /// - /// - - var matched = [], cur = elem[dir]; - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - /// - /// This member is internal only. - /// - /// - - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - /// - /// This member is internal only. - /// - /// - - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); -var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g, - rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i, - rtagName = /<([\w:]+)/, - rtbody = /"; - }, - wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }; - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and - - - -
-
- - - - - - - - Get Microsoft Silverlight - -
-
- - diff --git a/examples/NLogSilverlightApp.Web/NLogSilverlightAppTestPage.html b/examples/NLogSilverlightApp.Web/NLogSilverlightAppTestPage.html deleted file mode 100644 index 7d36231434..0000000000 --- a/examples/NLogSilverlightApp.Web/NLogSilverlightAppTestPage.html +++ /dev/null @@ -1,73 +0,0 @@ - - - - - NLogSilverlightApp - - - - - -
-
- - - - - - - - Get Microsoft Silverlight - -
-
- - diff --git a/examples/NLogSilverlightApp.Web/Properties/AssemblyInfo.cs b/examples/NLogSilverlightApp.Web/Properties/AssemblyInfo.cs deleted file mode 100644 index fb5603ca5a..0000000000 --- a/examples/NLogSilverlightApp.Web/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NLogSilverlightApp.Web")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NLogSilverlightApp.Web")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/examples/NLogSilverlightApp.Web/Silverlight.js b/examples/NLogSilverlightApp.Web/Silverlight.js deleted file mode 100644 index 80ff39708f..0000000000 --- a/examples/NLogSilverlightApp.Web/Silverlight.js +++ /dev/null @@ -1,2 +0,0 @@ -//v2.0.30511.0 -if(!window.Silverlight)window.Silverlight={};Silverlight._silverlightCount=0;Silverlight.__onSilverlightInstalledCalled=false;Silverlight.fwlinkRoot="http://go2.microsoft.com/fwlink/?LinkID=";Silverlight.__installationEventFired=false;Silverlight.onGetSilverlight=null;Silverlight.onSilverlightInstalled=function(){window.location.reload(false)};Silverlight.isInstalled=function(b){if(b==undefined)b=null;var a=false,m=null;try{var i=null,j=false;if(window.ActiveXObject)try{i=new ActiveXObject("AgControl.AgControl");if(b===null)a=true;else if(i.IsVersionSupported(b))a=true;i=null}catch(l){j=true}else j=true;if(j){var k=navigator.plugins["Silverlight Plug-In"];if(k)if(b===null)a=true;else{var h=k.description;if(h==="1.0.30226.2")h="2.0.30226.2";var c=h.split(".");while(c.length>3)c.pop();while(c.length<4)c.push(0);var e=b.split(".");while(e.length>4)e.pop();var d,g,f=0;do{d=parseInt(e[f]);g=parseInt(c[f]);f++}while(f");delete a.id;delete a.width;delete a.height;for(var c in a)if(a[c])b.push('');b.push("");return b.join("")};Silverlight.createObjectEx=function(b){var a=b,c=Silverlight.createObject(a.source,a.parentElement,a.id,a.properties,a.events,a.initParams,a.context);if(a.parentElement==null)return c};Silverlight.buildPromptHTML=function(b){var a="",d=Silverlight.fwlinkRoot,c=b.version;if(b.alt)a=b.alt;else{if(!c)c="";a="Get Microsoft Silverlight";a=a.replace("{1}",c);a=a.replace("{2}",d+"108181")}return a};Silverlight.getSilverlight=function(e){if(Silverlight.onGetSilverlight)Silverlight.onGetSilverlight();var b="",a=String(e).split(".");if(a.length>1){var c=parseInt(a[0]);if(isNaN(c)||c<2)b="1.0";else b=a[0]+"."+a[1]}var d="";if(b.match(/^\d+\056\d+$/))d="&v="+b;Silverlight.followFWLink("149156"+d)};Silverlight.followFWLink=function(a){top.location=Silverlight.fwlinkRoot+String(a)};Silverlight.HtmlAttributeEncode=function(c){var a,b="";if(c==null)return null;for(var d=0;d96&&a<123||a>64&&a<91||a>43&&a<58&&a!=47||a==95)b=b+String.fromCharCode(a);else b=b+"&#"+a+";"}return b};Silverlight.default_error_handler=function(e,b){var d,c=b.ErrorType;d=b.ErrorCode;var a="\nSilverlight error message \n";a+="ErrorCode: "+d+"\n";a+="ErrorType: "+c+" \n";a+="Message: "+b.ErrorMessage+" \n";if(c=="ParserError"){a+="XamlFile: "+b.xamlFile+" \n";a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}else if(c=="RuntimeError"){if(b.lineNumber!=0){a+="Line: "+b.lineNumber+" \n";a+="Position: "+b.charPosition+" \n"}a+="MethodName: "+b.methodName+" \n"}alert(a)};Silverlight.__cleanup=function(){for(var a=Silverlight._silverlightCount-1;a>=0;a--)window["__slEvent"+a]=null;Silverlight._silverlightCount=0;if(window.removeEventListener)window.removeEventListener("unload",Silverlight.__cleanup,false);else window.detachEvent("onunload",Silverlight.__cleanup)};Silverlight.__getHandlerName=function(b){var a="";if(typeof b=="string")a=b;else if(typeof b=="function"){if(Silverlight._silverlightCount==0)if(window.addEventListener)window.addEventListener("onunload",Silverlight.__cleanup,false);else window.attachEvent("onunload",Silverlight.__cleanup);var c=Silverlight._silverlightCount++;a="__slEvent"+c;window[a]=b}else a=null;return a};Silverlight.onRequiredVersionAvailable=function(){};Silverlight.onRestartRequired=function(){};Silverlight.onUpgradeRequired=function(){};Silverlight.onInstallRequired=function(){};Silverlight.IsVersionAvailableOnError=function(d,a){var b=false;try{if(a.ErrorCode==8001&&!Silverlight.__installationEventFired){Silverlight.onUpgradeRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==8002&&!Silverlight.__installationEventFired){Silverlight.onRestartRequired();Silverlight.__installationEventFired=true}else if(a.ErrorCode==5014||a.ErrorCode==2106){if(Silverlight.__verifySilverlight2UpgradeSuccess(a.getHost()))b=true}else b=true}catch(c){}return b};Silverlight.IsVersionAvailableOnLoad=function(b){var a=false;try{if(Silverlight.__verifySilverlight2UpgradeSuccess(b.getHost()))a=true}catch(c){}return a};Silverlight.__verifySilverlight2UpgradeSuccess=function(d){var c=false,b="2.0.31005",a=null;try{if(d.IsVersionSupported(b+".99")){a=Silverlight.onRequiredVersionAvailable;c=true}else if(d.IsVersionSupported(b+".0"))a=Silverlight.onRestartRequired;else a=Silverlight.onUpgradeRequired;if(a&&!Silverlight.__installationEventFired){a();Silverlight.__installationEventFired=true}}catch(e){}return c} \ No newline at end of file diff --git a/examples/NLogSilverlightApp.Web/Web.config b/examples/NLogSilverlightApp.Web/Web.config deleted file mode 100644 index 54f2f0b5ab..0000000000 --- a/examples/NLogSilverlightApp.Web/Web.config +++ /dev/null @@ -1,129 +0,0 @@ - - - - - -
- -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/NLogSilverlightApp/App.xaml b/examples/NLogSilverlightApp/App.xaml deleted file mode 100644 index 390b7c5bc9..0000000000 --- a/examples/NLogSilverlightApp/App.xaml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - diff --git a/examples/NLogSilverlightApp/App.xaml.cs b/examples/NLogSilverlightApp/App.xaml.cs deleted file mode 100644 index a8a8ae78ef..0000000000 --- a/examples/NLogSilverlightApp/App.xaml.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -namespace NLogSilverlightApp -{ - using System.IO; - using System.Windows.Browser; - using System.Xml; - - using NLog; - using NLog.Common; - using NLog.Config; - using NLog.Targets; - using NLog.Targets.Wrappers; - - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - InitializeComponent(); - - LogManager.ThrowExceptions = true; - - var target = new LogReceiverWebServiceTarget(); - target.EndpointAddress = new Uri(HtmlPage.Document.DocumentUri, "NLogReceiver.svc").ToString(); - target.Parameters.Add(new MethodCallParameter("message", "${message}")); - target.Parameters.Add(new MethodCallParameter("date", "${longdate}")); - - var buffer = new BufferingTargetWrapper(target) { BufferSize = 10, FlushTimeout = 1000 }; - - SimpleConfigurator.ConfigureForTargetLogging(buffer); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - this.RootVisual = new MainPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - LogManager.Configuration = null; - } - - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); - } - } - private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} diff --git a/examples/NLogSilverlightApp/MainPage.xaml b/examples/NLogSilverlightApp/MainPage.xaml deleted file mode 100644 index 1b957811c2..0000000000 --- a/examples/NLogSilverlightApp/MainPage.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - -