structured-log
Advanced tools
Comparing version 0.0.13 to 0.0.14
{ | ||
"name": "structured-log", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"description": "(Development version). NodeJS structured logging framework based on Serilog.", | ||
@@ -5,0 +5,0 @@ "main": "structured-log.js", |
@@ -28,5 +28,5 @@ #structured-log [![Build Status](https://travis-ci.org/structured-log/structured-log.svg)](https://travis-ci.org/structured-log/structured-log) | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.writeTo(coloredConsoleSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -43,5 +43,5 @@ ### Client-side | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.writeTo(structuredLog.consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -52,6 +52,6 @@ ### Multiple sinks | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.writeTo(consoleSink) | ||
.writeTo(httpSink({ url: '<some-url>' })) | ||
.createLogger(); | ||
.create(); | ||
@@ -62,10 +62,10 @@ ### Writing to another log | ||
var someOtherLog = structuredLog.configuration() | ||
var someOtherLog = structuredLog.configure() | ||
// ... setup ... | ||
.createLogger(); | ||
.create(); | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.writeTo(consoleSink) | ||
.writeTo(someOtherLog) | ||
.createLogger(); | ||
.create(); | ||
@@ -155,9 +155,11 @@ | ||
var log = structuredLog.configuration() | ||
.writeTo(httpSink({ | ||
url: 'http://somelogreceiver', // Configuration for the custom sink. | ||
batchSize: 1000, // Flush the queue every 1000 logs. | ||
var log = structuredLog.configure() | ||
.batch({ | ||
batchSize: 1000, // Flush the queue every 1000 logs. | ||
timeDuration: 3000, // Milliseconds to wait before flushing the queue. | ||
}) | ||
.createLogger(); | ||
.writeTo(httpSink({ | ||
url: 'http://somelogreceiver', // Configuration for the custom sink. | ||
}) | ||
.create(); | ||
@@ -248,3 +250,3 @@ *batchSize* specifies the amount of logs to include in a batch. When this number of logs are in the queue the queue will be flushed and processed by the sink. | ||
.writeTo(myCustomSink(customSinkOptions)) | ||
.createLogger(); | ||
.create(); | ||
@@ -275,3 +277,3 @@ ### As a Nodejs module | ||
.writeTo(myCustomSink(customSinkOptions)) | ||
.createLogger(); | ||
.create(); | ||
@@ -301,6 +303,6 @@ | ||
var log = structuredLog.configuration() | ||
.minimumLevel('WARN') | ||
var log = structuredLog.configure() | ||
.minLevel('WARN') | ||
.writeTo(consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -310,9 +312,9 @@ *minimumLevel* applies to subsequent sinks in the configuration, so you can use it to set a different level for each sink: | ||
var log = structuredLog.configuration() | ||
.minimumLevel('VERBOSE') | ||
.minLevel('VERBOSE') | ||
.writeTo(consoleSink()) | ||
.minimumLevel('INFO') | ||
.minLevel('INFO') | ||
.writeTo(httpSink()) | ||
.minimumLevel('ERROR') | ||
.minLevel('ERROR') | ||
.writeTo(emailSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -323,3 +325,3 @@ ### Filtering | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.filter(function (logEvent) { | ||
@@ -329,7 +331,7 @@ return someCondition(logEvent); | ||
.writeTo(consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
This kind of filtering affects subsequent sinks in the configuration, you can use it in combination with *clearFilter* to provide different filters for different sinks: | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.filter(function (logEvent) { | ||
@@ -343,3 +345,3 @@ return okForConsole(logEvent); | ||
})) | ||
.createLogger(); | ||
.create(); | ||
@@ -359,3 +361,3 @@ Logs can also be filtered after configuration, this effectively creates a new log with the added filter: | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.enrich({ | ||
@@ -366,7 +368,7 @@ UserId: getCurUserId(), | ||
.writeTo(consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
A function can also be provided that is evaluated at runtime to attach properties to log events in a more dynamic fashion: | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.enrich(function () { | ||
@@ -379,3 +381,3 @@ return { | ||
.writeTo(consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -398,6 +400,6 @@ Any number of properties can be attached to log messages in this manner. The properties may then be used in the log messages themselves: | ||
var log = structuredLog.configuration() | ||
var log = structuredLog.configure() | ||
.tag("authentication-system") | ||
.writeTo(consoleSink()) | ||
.createLogger(); | ||
.create(); | ||
@@ -404,0 +406,0 @@ Logs can also be tagged after configuration, this effectively creates a new log that has the desired tag: |
@@ -456,2 +456,3 @@ // Copyright 2014 Serilog Contributors | ||
var flushBatch = null; | ||
var batchFlushTimeout = null; // Used to cancel the pending flush. | ||
@@ -481,4 +482,2 @@ // | ||
var batchFlushTimeout = null; // Used to cancel the pending flush. | ||
// | ||
@@ -485,0 +484,0 @@ // Flush the batch. |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
396
0
40030