-
Notifications
You must be signed in to change notification settings - Fork 66
feat: Add new configuration options for logging. #1880 #2264
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to clarify that this only applies to managed agent logs, and that profiler logs are not affected by these settings. I don't know if that information is best placed in this PR description, in the configuration.xsd, or elsewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2264 +/- ##
==========================================
+ Coverage 81.30% 81.33% +0.02%
==========================================
Files 396 397 +1
Lines 24748 24755 +7
Branches 2993 2995 +2
==========================================
+ Hits 20122 20135 +13
+ Misses 3847 3841 -6
Partials 779 779
|
Thank you for submitting a pull request. Please review our contributing guidelines and code of conduct.
Description
Adds new configuration options for logging in the .NET agent, to enable control over max file size, number of log files retained and the log rollover strategy (by size or by day). Note that .NET Profiler logging is unaffected by these configuration options.
Adds 3 new optional attributes to the
<log>
element innewrelic.config
:logRollingStrategy
- possible values aresize
andday
, defaulting tosize
if not specified.maxLogFiles
- an integer specifying the maximum number of log files to retain, defaulting to4
if not specified. A value of0
will retain all log files.maxLogFileSizeBytes
- an integer specifying the maximum log file size in bytes, defaulting to 50MB. Only valid whenlogRollingStrategy
issize
. A value of0
specifies that there is no maximum log file size.Adds 3 new environment variables that will override the new attributes above if specified:
NEW_RELIC_LOG_ROLLING_STRATEGY
NEW_RELIC_LOG_MAX_FILES
NEW_RELIC_LOG_MAX_FILE_SIZE_BYTES
Resolves #1880.
Documentation preview is at https://deploy-preview-16283--docs-website-netlify.netlify.app/docs/apm/agents/net-agent/configuration/net-agent-configuration/#log-logRollingStrategy
Author Checklist
Reviewer Checklist