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

Consider Cutting Down on the Logging Noise at Startup #69

Closed
lread opened this issue Aug 1, 2024 · 4 comments · Fixed by #73
Closed

Consider Cutting Down on the Logging Noise at Startup #69

lread opened this issue Aug 1, 2024 · 4 comments · Fixed by #73
Assignees
Labels
enhancement New feature or request needs analysis Further hammock time is required to figure out the best solution

Comments

@lread
Copy link
Contributor

lread commented Aug 1, 2024

Currently

When clj-watson starts up it emits quite a few log lines, here's an example:

Jul 31, 2024 5:34:58 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheManager 
INFO: Instance is null, returning unconfigured instance
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheManager 
INFO: Setting default auxiliaries to "ODC"
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheManager 
INFO: setting defaultCompositeCacheAttributes to [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 0, maxSpoolPerRun = -1, diskUsagePattern = UPDATE, spoolChunkSize = 2 ]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheManager 
INFO: setting defaultElementAttributes to [ IS_LATERAL = false, IS_SPOOL = true, IS_REMOTE = false, IS_ETERNAL = false, MaxLifeSeconds = 86400, IdleTime = 1800, CreateTime = 1722461699056, LastAccessTime = 1722461699056, getTimeToLiveSeconds() = 86399, createTime = 1722461699056 ]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache 
INFO: initialized MemoryCache for CENTRAL
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: Constructed cache with name [CENTRAL] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 0, maxSpoolPerRun = -1, diskUsagePattern = UPDATE, spoolChunkSize = 2 ]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: No cache event logger defined for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: Using standard serializer [org.apache.commons.jcs3.utils.serialization.StandardSerializer@58914623] for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Set maxKeySize to: "1,000,000"
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Cache file root directory: /tmp/db/cache
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [CENTRAL] : Indexed Disk Cache is alive.
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache 
INFO: initialized MemoryCache for POM
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: Constructed cache with name [POM] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 0, maxSpoolPerRun = -1, diskUsagePattern = UPDATE, spoolChunkSize = 2 ]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: No cache event logger defined for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: Using standard serializer [org.apache.commons.jcs3.utils.serialization.StandardSerializer@75643efa] for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Set maxKeySize to: "1,000,000"
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Cache file root directory: /tmp/db/cache
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [POM] : Indexed Disk Cache is alive.
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.memory.AbstractDoubleLinkedListMemoryCache 
INFO: initialized MemoryCache for NODEAUDIT
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCache 
INFO: Constructed cache with name [NODEAUDIT] and cache attributes [ useLateral = true, useRemote = true, useDisk = true, maxObjs = 0, maxSpoolPerRun = -1, diskUsagePattern = UPDATE, spoolChunkSize = 2 ]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: No cache event logger defined for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.AuxiliaryCacheConfigurator 
INFO: Using standard serializer [org.apache.commons.jcs3.utils.serialization.StandardSerializer@2d36a825] for auxiliary [jcs.auxiliary.ODC]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Set maxKeySize to: "1,000,000"
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Cache file root directory: /tmp/db/cache
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.auxiliary.disk.indexed.IndexedDiskCache 
INFO: Region [NODEAUDIT] : Indexed Disk Cache is alive.
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheConfigurator 
INFO: Parsed regions [CENTRAL, POM, NODEAUDIT]
Jul 31, 2024 5:34:59 P.M. org.apache.commons.jcs3.engine.control.CompositeCacheManager 
INFO: Finished configuration in 48 ms.

My Take

Because the presentation is noisy and repetitive I am likely to just skip over the entire log.
The only thing I see that seems relevant to me is the cache file root directory.

As a user, I ask myself why a tool is telling me things I do not need to know.
And then I wonder if maybe I do need to know about these things it is telling me.
And then I feel a bit annoyed with the tool when I realize I probably don't.

Proposal

Look into a way to reduce this startup log noise to maybe:

Nvd database root directory: /tmp/db/cache

Next Steps

If you agree, I can look into this more and follow up with a PR.

@seancorfield seancorfield added needs analysis Further hammock time is required to figure out the best solution enhancement New feature or request labels Aug 1, 2024
@seancorfield
Copy link
Contributor

It seems like all that org.apache.commons.jcs3.* logging could be suppressed and new, specific (useful!) logging from Watson added?

@seancorfield
Copy link
Contributor

Does this tie in to #68 ?

@lread
Copy link
Contributor Author

lread commented Aug 1, 2024

Ya is certainly related to #68.

Since clj-watson turns off logging via slf4j-nop, we can assume that these logs lines are not redirected through slf4j.

I think by default Apache Commons JCS uses JUL but can be told to use log4j2.
Can experiment with log bridges etc. I think we want all logs redirected to a single logging fwk where we control what we want on and off.

@lread
Copy link
Contributor Author

lread commented Aug 1, 2024

Ok @seancorfield, I've got something working locally.

It makes sense to switch from slf4j-nop to something real.
I'll start with logback-classic (can adjust if you prefer something else) with minimal logging config to suppress the noisy org.apache.commons.jcs3.*.
This will turn on dependency-check logging - which includes logging for #68.

lread added a commit to lread/clj-watson that referenced this issue Aug 1, 2024
We could have continued with slf4-nop, but I opted to switch to
logback-classic to exercise suppression of Apache Commons JCS `INFO`
level logging.

This enables logging in general. Relates to:
- clj-holmes#68 you'll see dependency-check logging during db download/update
- clj-holmes#67 you'll see dependency-check warn about lack of nvd api key

I chose a log pattern I thought might work. We can revisit, if
necessary, in a separate issue.

Closes clj-holmes#69
seancorfield pushed a commit that referenced this issue Aug 1, 2024
We could have continued with slf4-nop, but I opted to switch to
logback-classic to exercise suppression of Apache Commons JCS `INFO`
level logging.

This enables logging in general. Relates to:
- #68 you'll see dependency-check logging during db download/update
- #67 you'll see dependency-check warn about lack of nvd api key

I chose a log pattern I thought might work. We can revisit, if
necessary, in a separate issue.

Closes #69
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs analysis Further hammock time is required to figure out the best solution
Development

Successfully merging a pull request may close this issue.

2 participants