Vostok.Logging.Hercules
An implementation of Vostok ILog that send events to Hercules. Also provides mapping from Hercules events back to log events.
Install
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard |
README
Vostok.Logging.Hercules
An implementation of Vostok ILog that send events to Hercules. Also provides mapping from Hercules events back to Log Events.
Build guide: https://github.com/vostok/devtools/blob/master/library-dev-conventions/how-to-build-a-library.md
User documentation: https://vostok.gitbook.io/logging/
Here's how LogEvent instances are mapped into Hercules events (according to schema):
Timestamp(mandatory) corresponds to:- Hercules event built-in timestamp —
UtcDateTimeofTimestamp. utcOffsettag — alongtag with offset from UTC expressed in 100-ns ticks.
- Hercules event built-in timestamp —
Level--->leveltag ofstringtype.MessageTemplate--->messageTemplatetag ofstringtype.RenderedMessage--->messagetag containing rendered text.Propertiesdictionary corresponds to a container with nameproperties. This container contains a tag for each pair. Keys are translated as-is, and the values are handled according to following conventions:- If the value is a primitive scalar or a vector of primitive scalars natively supported by Hercules (such as
int,long,guid,string, etc), it's mapped as-is. - Otherwise the value gets converted to
string: either stringified directly (if it properly overridesToString()) or serialized to JSON. No further container-like structure is allowed, all values end up being 'flat'.
- If the value is a primitive scalar or a vector of primitive scalars natively supported by Hercules (such as
Exceptionobject corresponds to a container with nameexceptionand following tags:- Exception runtime type (e.g.
System.NullReferenceException) --->typetag of typestring. - Exception message --->
messagetag of typestring. - Nested exceptions (e.g.
InnerExceptionandInnerExceptionsforAggregateException) --->innerExceptionstag of typeVectorwhich contains other exceptions in the same format. - Stacktrace of exception --->
stackFramestag of typeVector<StackFrame>.StackFrameis a container of following tags which describe a point of code which executed when the exception occured:function- a name of function (method).type- a type whenfunctionis declared.file- file name.line- line number.column- column number.
- Exception runtime type (e.g.
Changes from Previous Version
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.