Skip to content

Commit

Permalink
Merge pull request #149 from JaniAnttonen/development
Browse files Browse the repository at this point in the history
Merge development to main, draft a new release
  • Loading branch information
JaniAnttonen authored Apr 9, 2024
2 parents 7e6c89a + 3f0bcf3 commit 5edd9d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LokiTransport() takes a Javascript object as an input. These are the options tha
| `json` | Use JSON instead of Protobuf for transport | true | false |
| `batching` | If batching is not used, the logs are sent as they come | true | true |
| `clearOnError` | Discard any logs that result in an error during transport | true | false |
| `replaceTimestamp` | Replace any log timestamps with Date.now() | true | false |
| `replaceTimestamp` | Replace any log timestamps with Date.now(). Warning: Disabling `replaceTimestamp` may result in logs failing to upload due to recent changes in the upstream Loki project. It is recommended to leave this option enabled unless you have a specific reason to disable it. | true | true |
| `labels` | custom labels, key-value pairs | { module: 'http' } | undefined |
| `format` | winston format (https://github.com/winstonjs/winston#formats) | simple() | undefined |
| `gracefulShutdown` | Enable/disable graceful shutdown (wait for any unsent batches) | false | true |
Expand Down
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LokiTransport extends Transport {
batching: options.batching !== false,
clearOnError: options.clearOnError,
onConnectionError: options.onConnectionError,
replaceTimestamp: options.replaceTimestamp,
replaceTimestamp: options.replaceTimestamp !== false,
gracefulShutdown: options.gracefulShutdown !== false,
timeout: options.timeout
})
Expand All @@ -52,7 +52,8 @@ class LokiTransport extends Transport {
})

// Deconstruct the log
const { label, labels, timestamp, level, message, ...rest } = info
const { label, labels, timestamp, message, ...rest } = info
const level = info[Symbol.for('level')]

// build custom labels if provided
let lokiLabels = { level: level }
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "winston-loki",
"version": "6.0.8",
"version": "6.1.0",
"description": "A Winston transport for Grafana Loki",
"keywords": [
"winston",
Expand Down

0 comments on commit 5edd9d0

Please sign in to comment.