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

Logger config #1048

Closed
ckanner opened this issue May 29, 2020 · 8 comments
Closed

Logger config #1048

ckanner opened this issue May 29, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request help wanted Good issue for contributors to OpenTelemetry Service to pick up
Milestone

Comments

@ckanner
Copy link

ckanner commented May 29, 2020

Otelcol use zap to logger something. But now, I can only config my looger by set log-level and log-profile.

How can I config my logger custom? I want to set something like Encoding, OutputPaths, logrotate and so on.

@bogdandrutu
Copy link
Member

Can you provide details how others do this? Also what are the configs you want to offer?

@jrcamp
Copy link
Contributor

jrcamp commented Jul 30, 2020

@bogdandrutu I think we could use Zap's config struct as-is (it has yaml and json tags)

https://github.com/uber-go/zap/blob/master/config.go#L58

This would allow the user to completely configure Zap to their liking.

@bogdandrutu
Copy link
Member

Sounds good, it should probably be part of the "service" configuration :)

@bogdandrutu bogdandrutu added the help wanted Good issue for contributors to OpenTelemetry Service to pick up label Aug 4, 2020
@bogdandrutu bogdandrutu added this to the Backlog milestone Aug 4, 2020
@andrewhsu andrewhsu added enhancement New feature or request and removed feature request labels Jan 6, 2021
@pureklkl
Copy link
Contributor

@bogdandrutu
I would like to work on it and make a pr for adding following configs, which just copied the zap config from the link above.
I am not going to add SamplingConfig and EncoderConfig which include interfaces for custom implementation.

// 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"``

@bogdandrutu
Copy link
Member

The PR was merged for this, closing

Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this issue Jul 5, 2024
@bvsvas
Copy link

bvsvas commented Jul 31, 2024

@pureklkl - What are the options for logrotate in OTelCol? Could you please provide sample configuration?

@pureklkl
Copy link
Contributor

@bvsvas it was not added

@bvsvas
Copy link

bvsvas commented Aug 1, 2024

Created a GitHub Issue# #10768

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Good issue for contributors to OpenTelemetry Service to pick up
Projects
None yet
Development

No branches or pull requests

6 participants