@camatsoft/tracelog v1.0.6
Description
Simplify Your Logging with CamatSoft.TraceLog
CamatSoft.TraceLog is a lightweight and extensible tracing solution designed to streamline logging in your .NET projects. It offers:
- Simple configuration : Get started with just a few lines of code.
- Multi-destination support : Log to the console, files, or third-party services like Serilog or Elastic Stack.
- Robust extensibility : Tailor the package to your specific needs with custom hook systems.
- Optimized performance : Minimal impact on your application’s performance.
Adopt CamatSoft.TraceLog and take full control of your logging, de facto.
TraceLog SDK for TypeScript by CamatSoft
| Integrations | NPM Version | Documentation | |
|---|---|---|---|
| CamatSoft.TraceLog | |||
| CamatSoft.TraceLog.Contract |
DSN
Register on CamatSoft.TraceLog
DSN Test
https://pRGLY9uhyKPu4b44s3Pe6a6pk46NBbRz4b2E2RMpb648h8DR2N7K7qsb97XFYM2r@o20241101.tracelog.camatsoft.com/2024111101
.
Constructor
CamatsoftTraceLog.Sdk.init()
CamatsoftTraceLog.Sdk.init(dsn:string)
CamatsoftTraceLog.Sdk.init(dsn:string, callbackfn?: (scope: Scope) => void)
CamatsoftTraceLog.Sdk.init(options:TraceLogOptions)
CamatsoftTraceLog.Sdk.init(callbackfn?: (options: TraceLogOptions) => void)
Methods
| Name | Params | Description |
|---|---|---|
| async captureExecption(ex: Exception, callbackfn?: (scope: Scope) => void): Promise< CaptureExceptionResponseDto> | ex is Exception, scope is Action contains a scope | Capture exception |
| async captureMessage(message: string, level?: DiagnosticLevel, callbackfn?: (scope: Scope) => void): Promise< CaptureMessageResponseDto> | message is a message log, level is a level type of log, scope is Action contains a scope | CaptureMessage |
Exemples
in .ts (EntryPoint) :
import * as CamatsoftTracelog from '@camatsoft/tracelog'
CamatsoftTracelog.Sdk.init(options => {
options.dsn = "https://azerty@o0000.tracelog.camatsoft.com/999999";
options.configureScope(scope =>
{
scope.SetTag("MyTag", "MyValue");
});
});in another file .ts :
import * as CamatsoftTracelog from '@camatsoft/tracelog'
try
{
throw "MyException";
}
catch (ex)
{
let captureResponseDto = CamatsoftTracelog.Sdk.captureExecption(new CamatsoftTracelog.Exception({ message: ex }), scope =>
{
scope.SetTag("UserName", "Georges");
});
}Release Notes
v1.0.4
Fix bug setDiagnosticLevel in scope
v1.0.3
Add dependencies Add setDiagnosticLevel in scope
v1.0.2
Add export class
v1.0.1
Add ReadMe
v1.0.0
Create solution