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

Add more log configs #4508

Merged
merged 9 commits into from
Dec 9, 2021
Merged

Conversation

pureklkl
Copy link
Contributor

@pureklkl pureklkl commented Dec 3, 2021

Description:
Adding a feature, expose more configs for the collector zap logger.

// DisableCaller stops annotating logs with the calling function's file
// name and line number. By default, all logs are annotated.
DisableCaller bool `mapstructure:"disableCaller"`

// DisableStacktrace completely disables automatic stacktrace capturing. By
// default, stacktraces are captured for WarnLevel and above logs in
// development and ErrorLevel and above in production.
DisableStacktrace bool `mapstructure:"disableStacktrace"`

// OutputPaths is a list of URLs or file paths to write logging output to.
// See Open for details.
OutputPaths []string `mapstructure:"outputPaths"`

// ErrorOutputPaths is a list of URLs to write internal logger errors to.
// The default is standard error.
//
// Note that this setting only affects internal errors; for sample code that
// sends error-level logs to a different location from info- and debug-level
// logs, see the package-level AdvancedConfiguration example.
ErrorOutputPaths []string `mapstructure:"errorOutputPaths"`

// InitialFields is a collection of fields to add to the root logger.
InitialFields map[string]interface{} `mapstructure:"initialFields"``

Link to tracking Issue: #1048

Testing: enhance the current marshaler test to include the new configs, tested manually.

@pureklkl pureklkl requested review from a team and tigrannajaryan December 3, 2021 22:52
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 3, 2021

CLA Signed

The committers are authorized under a signed CLA.

config/service.go Outdated Show resolved Hide resolved
config/service.go Outdated Show resolved Hide resolved
config/service.go Outdated Show resolved Hide resolved
config/service.go Outdated Show resolved Hide resolved
config/service.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Dec 8, 2021

Codecov Report

Merging #4508 (31051a0) into main (95201d4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4508   +/-   ##
=======================================
  Coverage   90.54%   90.54%           
=======================================
  Files         180      180           
  Lines       10466    10474    +8     
=======================================
+ Hits         9476     9484    +8     
  Misses        774      774           
  Partials      216      216           
Impacted Files Coverage Δ
config/service.go 100.00% <ø> (ø)
config/configunmarshaler/defaultunmarshaler.go 100.00% <100.00%> (ø)
service/internal/telemetrylogs/logger.go 88.88% <100.00%> (+1.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95201d4...31051a0. Read the comment docs.

@bogdandrutu
Copy link
Member

Please add a changelog entry

@bogdandrutu bogdandrutu merged commit 265a06a into open-telemetry:main Dec 9, 2021
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.

2 participants