VOOZH about

URL: https://www.nuget.org/packages/magic.lambda.logging/16.9.0

⇱ NuGet Gallery | magic.lambda.logging 16.9.0




👁 Image
magic.lambda.logging 16.9.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package magic.lambda.logging --version 16.9.0
 
 
NuGet\Install-Package magic.lambda.logging -Version 16.9.0
 
 
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="magic.lambda.logging" Version="16.9.0" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="magic.lambda.logging" Version="16.9.0" />
 
Directory.Packages.props
<PackageReference Include="magic.lambda.logging" />
 
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add magic.lambda.logging --version 16.9.0
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: magic.lambda.logging, 16.9.0"
 
 
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package magic.lambda.logging@16.9.0
 
 
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=magic.lambda.logging&version=16.9.0
 
Install as a Cake Addin
#tool nuget:?package=magic.lambda.logging&version=16.9.0
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

magic.lambda.logging - Log support in Hyperlambda

This project contains logging wrapper slots for Magic. More specifically, this project provides the following slots allowing you to create log entries.

  • [log.info] - Information log entries, typically smaller pieces of information
  • [log.debug] - Debug log entries, typically additional debugging information not enabled in production
  • [log.error] - Error log entries, typically exceptions
  • [log.fatal] - Fatal log entries, from which the application cannot recover from

In addition to the above slots there are also slots that allows you to retrieve log items, and/or some basic statistics from your log. These can be found below.

  • [log.count] - Counts number of log items, optionally matching the specified filter condition
  • [log.get] - Returns the log item with the specified id
  • [log.query] - Returns a list of log items according to its arguments
  • [log.capabilities] - Returns the capabilities of the log implementation

By default, this project will log into your magic.log_entries database/table, using either MySQL, PostgreSQL, Microsoft SQL Server or SQLite. This allows you to use SQL to generate statistics on top of your logs. An example of creating a log entry can be found below.

log.info:Howdy world from magic.lambda.logging

You can of course exchange the above [log.info] with [log.error], [log.debug] or [log.fatal].

Children nodes will be assumed to be "meta information" associated with the invocation, allowing you to log data such as follows.

log.info:Some log entry
 username:foo
 ip:123.123.123.123

The above will log "some log entry" for you, and associate [username] and [ip] with your log entry as meta data. This allows you to use the same log entry for similar log types, and parametrise your log entry with meta information, giving you aggregate capabilities on log entries having the same content, while still preserving meta information unique to each log entry. Notice, if you don't provide a value to your log invocation, no meta data will be associated with your log entry, but all arguments will rather be concatenated as a single string and end up in the "content" parts of your log entry after having been evaluated.

Exception logging

The [log.error] and [log.fatal] slots give you the option of logging an exception stack trace, by parametrising your invocation with an [exception] argument, which will not be assumed to be meta information, but rather end up in the "exception" column as you create the log item. All other parameters will still be evaluated or used as meta information.

Log level configuration

The slots [log.debug], [log.info], [log.error], and [log.fatal] are actually logging with their last parts becoming the "type" of log item. This is similar to how Log4Net and Log4J works, and can be turned on and off as you see fit. The level is an increasing leverage type of value, applied in the following order.

  • debug
  • info
  • error
  • fatal

This implies that if you set the level to for instance "error" no invocations to [log.debug] or [log.info] will log anything into your log, allowing you to "turn up and down" the level of logging you need as a configuration setting through your "appsetting.json" file. Below is an example configuration setting the level to "info". The default value for log level is "debug". In a production environment you might want to increase this to at least "info".

{
 "magic": {
 "logging": {
 "level": "info"
 }
 }
}

The above value will for instance log everything except invocations to [log.debug].

Querying your log

Notice - To see the capabilities of your particular log implementation please invoke [log.capabilities] and verify your particular log implementation can actually do what you need for it to do, since not all implementations have the same capabilities - Implying things such as filtering log items according to content, and/or timeshifting log items, etc, might not be implemented for your particular implementation.

To retrieve log items sequentially you can use [log.query]. This slot can optionally take a [from] argument being the id of an existing log item from where to start retrieving items, and a [max] argument being the maximum number of records to return. If no [max] argument is specified, the default value of this is 10. In addition the invocation can be fiven a string as its value, which if given must match the content of your log items for an item to be returned. Below is an example of usage.

log.query:"We successfully authenticated user 'root'"
 from:555
 max:20

The above will return log items starting from id 554 and down, and return only 20 records, and all returned records will have a content value of "We successfully authenticated user 'root'". To return a single log item you can use [log.get] and pass in the id of the log item you want to retrieve as its value.

Notice - If your particular log implementation does not support querying you cannot query items according to content as illustrated above, but rather only page items. Invoke [log.capabilities] to see if your implementation supports querying before relying upon its existence.

Project website for magic.lambda.logging

The source code for this repository can be found at github.com/polterguy/magic.lambda.logging, and you can provide feedback, provide bug reports, etc at the same place.

Copyright and maintenance

The projects is copyright of Aista, Ltd 2021 - 2023, and professionally maintained by AINIRO your friendly ChatGPT website chatbot vendor.

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 was computed.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 was computed.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on magic.lambda.logging:

Package Downloads
magic.library

Helper project for Magic to wire up everything easily by simply adding one package, and invoking two simple methods. When using Magic, this is (probably) the only package you should actually add, since this package pulls in everything else you'll need automatically, and wires up everything sanely by default. To use package go to https://polterguy.github.io

magic.lambda.scheduler

Helper slots for Magic to allow you to dynamically create tasks, either as a part of your custom workflow, and/or as scheduled tasks intended to be executed at some interval, or future time. To use package go to https://polterguy.github.io

magic.lambda.sockets

Web socket helper project for Magic, giving you support for web sockets connections from and to Hyperlambda. To use package go to https://polterguy.github.io

magic.data.cql

CQL data adapters for Magic to store files and folders, etc. To use package go to https://polterguy.github.io

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
17.2.0 2,021 1/22/2024
17.1.7 547 1/12/2024
17.1.6 507 1/11/2024
17.1.5 505 1/5/2024
17.0.1 583 1/1/2024
17.0.0 1,040 12/14/2023
16.11.5 923 11/12/2023
16.9.0 899 10/9/2023
16.7.0 1,457 7/11/2023
16.4.1 1,282 7/2/2023
16.4.0 1,302 6/22/2023
16.3.1 1,281 6/7/2023
16.3.0 1,281 5/28/2023
16.1.9 1,574 4/30/2023
15.10.11 1,568 4/13/2023
15.9.1 1,651 3/27/2023
15.9.0 1,492 3/24/2023
15.8.2 1,529 3/20/2023
15.7.0 1,494 3/6/2023
15.5.0 3,016 1/28/2023
Loading failed