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 1 week 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

  • Robin Shen commented 6 days ago

    @xavier-github76 thanks for sending the patch. Nevertheless, the cleanest fix is to modify Bootstrap directly. I've done that and will get it into next patch release. Also added your account to Contributor group and you will be able to submit PR in future.

  • roy commented 6 days ago

    @robin Hi Robin,

    Thanks for implementing the cleaner fix in Bootstrap!

    Just a quick heads-up: I think you might have accidentally added the issue author (@xavier-github76) to the Contributor group instead of me. My GitHub account is @wds3817.

    Could you please add my account when you get a chance? Thank you!

    Best regards, Roy

  • Robin Shen commented 6 days ago

    @wds3817 added correct account, but mentioned incorrectly.

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