NASA-PDS / harvest

Standalone Harvest client application providing the functionality for capturing and indexing product metadata into the PDS Registry system (https://github.com/nasa-pds/registry).
https://nasa-pds.github.io/registry
Other
4 stars 3 forks source link

Add the date time in the log messages #203

Open tloubrieu-jpl opened 3 weeks ago

tloubrieu-jpl commented 3 weeks ago

💡 Description

We want to be able to link errors client side with events serverside.

⚔️ Parent Epic / Related Tickets

No response

al-niessner commented 2 weeks ago

@tloubrieu-jpl

It seems that harvest does not have a log4j configuration file which should make @nutjob4life pretty excited since it did so in validate. Do we have a PDS standard that we should use rather than the log4j default?

If we want to add datetime, then we need a configuration. If we need a configuration, then we should start with standard so that I can roll it into registry-mgr too since it does not have one either. For some reason, jparser does have one if somebody (@nutjob4life) who knows and likes log4j wants to review then nominate it as the PDS standard. Hopefully @nutjob4life has one in a repository that I do not use that is even better and includes datatime.

nutjob4life commented 2 weeks ago

🤣

@al-niessner, you made my morning!

I am not exactly a fan of log4j (as I'm not much of a fan of Java) but I'll certainly support its use and adoption. I don't have a good prototypical log4j (or other Java logging framework) in my personal toolbox either. That means I'm open to just about anything.

I seem to recall that Apache Directory had a pretty flexible and useful logging setup as I remember having to alter its log4j.properties several times while debugging custom add-ons.

That said, maybe this'll do it?

log4j.appender.*.layout.ConversionPattern=[%d{HH:mm:ss}] %p [%c] - %m%n

If not, replace the * with the specific appender you're using.

al-niessner commented 2 weeks ago

@nutjob4life

Wow, I did not realize you did not typing more than necessary (Java). In our 10 minutes of overlap on validate you seemed to have a strong opinion on validate's abuse of log4j. I took that as knowing log4j well.

Yes, jparser log4j configuration uses the same layout for date time. So, if @tloubrieu-jpl is good with it I will just use that one (whole log4j configuration) as our standard. Maybe registry-api has one he likes better.

nutjob4life commented 2 weeks ago

I fake it 'til I make it, my friend @al-niessner! 🤣