No date in backup-db.log, check-data-version.log, restore-db.log #2805
xavier-github76 opened 1 month ago

Logs don't have date in :

backup-db.log

image_2.png

check-data-version.log

image.png

restore-db.log

image_3.png

Date is present only in console.log and server.log

  • xavier-github76 changed title 1 month ago
    Previous Value Current Value
    No date in check-data-version.log
    No date in backup-db.log, check-data-version.log, restore-db.log
  • Robin Shen changed fields 1 month ago
    Name Previous Value Current Value
    Priority
    Normal
    Minor
  • roy commented 2 days ago

    Hi, I'd like to contribute a fix for this issue (patch attached).

    Root cause: for command runs (backup-db, restore-db, check-data-version, ...), Bootstrap.configureLogging() in commons-bootstrap sets the file log pattern to %-5level - %msg%n, which lacks %date - while server mode uses %date %-5level [%thread] %logger{36} %msg%n. Hence command log files have no dates.

    Fix: add a static helper in CommandHandler that prepends %date to the FILE appender's pattern. It is a no-op in server mode (Bootstrap.command == null guard) and idempotent (skips if the pattern already contains %d, so it won't double-prepend if commons is fixed upstream later). It is called from the CommandHandler constructor (covers backup-db, restore-db, check-data-version, clean-db, reset-admin-password, apply-db-constraints, translate) and from a new Upgrade constructor, since Upgrade extends AbstractPlugin directly (covers upgrade.log). Console output is left unchanged.

    Verified with a minimal repro replaying the command-mode logging config: before - INFO - ...; after - 2026-07-10 13:42:29,714 INFO - ....

    I tried forking this project to raise a proper PR, but my account is not authorized to create projects. Happy to submit a PR instead if fork permission can be granted.od-2805-fix.patch

1/1
Type
Improvement
Priority
Minor
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-2805
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover