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

Improve logging #773

Merged
merged 3 commits into from
Feb 2, 2024
Merged

Improve logging #773

merged 3 commits into from
Feb 2, 2024

Conversation

scottqueen-bixal
Copy link
Contributor

@scottqueen-bixal scottqueen-bixal commented Feb 2, 2024

Fixes #772

When running cron.js the spawned scripts executed were outputing logging was not making its way up to the cloud log stream.

This works to update winston for better reporting syntax and includes a new function to handle logger messages, specifically if we have an error to log it as an error.

@scottqueen-bixal scottqueen-bixal marked this pull request as ready for review February 2, 2024 11:27
Multiple loggers were initialized throughout the app with differring config.  Replace with calls
to the application logger .initialize method.  Also adds an application log level which can be set
with ANALYTICS_LOG_LEVEL env var.
@levinmr
Copy link
Contributor

levinmr commented Feb 2, 2024

@scottqueen-bixal I like your changes. I went a little farther with it and moved the logger config to a single place, since the app was creating loggers in several different files. Also added an optional env var to set the log level. Take a look and see what you think

@scottqueen-bixal
Copy link
Contributor Author

@scottqueen-bixal I like your changes. I went a little farther with it and moved the logger config to a single place, since the app was creating loggers in several different files. Also added an optional env var to set the log level. Take a look and see what you think

Excellent, with test and all! - This looks good to me if we want to push up and see how it goes on cloud log stream?

@levinmr levinmr merged commit fbd7e5c into develop Feb 2, 2024
4 checks passed
@levinmr levinmr deleted the improve-logging branch February 2, 2024 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve logging when running cron.js
2 participants