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

Only log hikari errors. #373

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

nishihatapalmer
Copy link
Contributor

  • removes noise from the main DROID log in normal operation.

Note: you won't see these changes unless you get rid of your .droid6 folder. If you have an existing installation, DROID will continue to use the previous log4j2.properties file already installed.

  * removes noise from the main DROID log in normal operation.
@sparkhi sparkhi added this to In progress in DROID Kanban board 6.5 via automation Feb 6, 2020
@sparkhi sparkhi moved this from In progress to Backlog in DROID Kanban board 6.5 Feb 6, 2020
@sparkhi
Copy link
Collaborator

sparkhi commented Feb 7, 2020

Hi @nishihatapalmer,
Could you please post some instructions which would help me test it. It would be great to see the problem and then test after applying the changes you have provided.

TIA,

@nishihatapalmer
Copy link
Contributor Author

nishihatapalmer commented Feb 7, 2020

Problem
HikariPool log messages appear in the main DROID log. They are harmless, but are noise. Each time a profile is created in the GUI version of DROID, you will see a HikariPool initialising itself in the log output.

Solution
Ensure log messages from Hikari are only at ERROR level. This is done by altering the log4j properties file. You will be able to see that we have similarly disabled log output messages for apache and other libraries we use.

Testing
I'm not aware of a way to automatically test this, although there is probably some magic that would let you do it. The easiest way to test is to run either an older version of DROID, or this version but after an older version has been previously run, and observe the log output. You should see HikariPool messages. This is because DROID will be using an older log4j properties file in its .droid6 folder.

Then, delete or rename the .droid6 folder under your home directory, and run this version of DROID This will force DROID to recreate the folder and files, putting in the new log4j property file there. Each time a profile is created, you should no longer see HikariPool messages in the DROID log.

@sparkhi
Copy link
Collaborator

sparkhi commented Feb 7, 2020

  • I checked out the revision corresponding to 'prepare release droid-6.4'.
  • I deleted the .droid6 folder
  • Built locally
  • Ran the local version
    I did not see any specific message related to hikaripool,

Do you reckon I've gone too far back? I checked the console as well as the log file under .droid6/logs and could not find the messages. Could you point me in the right direction?

@nishihatapalmer
Copy link
Contributor Author

nishihatapalmer commented Feb 7, 2020 via email

@nishihatapalmer
Copy link
Contributor Author

nishihatapalmer commented Feb 7, 2020

Essentially, all this PR does is to ensure log entries from Hikari only appear at an ERROR level, the same as we do for apache and some others.

To test, you need the log4j property file from the latest version of DROID, and the one from this PR.

If you run the 6.5-SNAPSHOT master of DROID with a standard log4j property file in the .droid6 folder, you should see HikariPool entries.

If you replace the log4j property file with the one from this PR, then the HikariPool entries should disappear.

@nishihatapalmer
Copy link
Contributor Author

It does raise the issue of what we do with things like log configuration updates to DROID. Anyone who's had any previous version installed simply won't get these updates, unless they blow away their .droid6 folder.

Should DROID check for differences and put in the new version if it's not there with a warning message? Or rename the old file and put the new one in?

@sparkhi sparkhi merged commit 364edb0 into digital-preservation:master Feb 10, 2020
DROID Kanban board 6.5 automation moved this from Backlog to Done Feb 10, 2020
@jcharlet jcharlet added this to the 6.5 milestone Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants