Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timestamp prefix in logs #1120

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

All changes that impact users of this module are documented in this file, in the [Common Changelog](https://common-changelog.org) format with some additional specifications defined in the CONTRIBUTING file. This codebase adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased [patch]

> Development of this release was supported by the [French Ministry for Foreign Affairs](https://www.diplomatie.gouv.fr/fr/politique-etrangere-de-la-france/diplomatie-numerique/) through its ministerial [State Startups incubator](https://beta.gouv.fr/startups/open-terms-archive.html) under the aegis of the Ambassador for Digital Affairs.

### Fixed

- Fix timestamp prefix format in logs

## 2.7.0 - 2024-11-20

_Full changeset and discussions: [#1118](https://github.com/OpenTermsArchive/engine/pull/1118)._
Expand Down
2 changes: 1 addition & 1 deletion scripts/dataset/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { combine, timestamp, printf, colorize } = winston.format;

logger.format = combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, counter, hash, timestamp }) => {
const prefix = counter && hash ? `${counter.toString().padEnd(6)} ${hash.padEnd(40)}` : '';

Expand Down
2 changes: 1 addition & 1 deletion src/collection-api/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (config.get('@opentermsarchive/engine.logger.sendMailOnError')) {
const logger = winston.createLogger({
format: combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, timestamp }) => {
const timestampPrefix = config.get('@opentermsarchive/engine.logger.timestampPrefix') ? `${timestamp} ` : '';

Expand Down
2 changes: 1 addition & 1 deletion src/logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { combine, timestamp, printf, colorize } = winston.format;

const alignedWithColorsAndTime = combine(
colorize(),
timestamp({ format: 'YYYY-MM-DDTHH:MM:SSZ' }),
timestamp({ format: 'YYYY-MM-DDTHH:mm:ssZ' }),
printf(({ level, message, timestamp, serviceId, termsType, documentId }) => {
const servicePrefix = serviceId && termsType
? `${serviceId} — ${termsType}${documentId ? `:${documentId}` : ''}`
Expand Down
Loading