Open daoweili opened 1 year ago
I think you can register a logback or log4j appender and set the log level on the appender - no extension needed.
@daoweili also check out this slack discussion which may be helpful in your case https://cloud-native.slack.com/archives/CJFCJHG4Q/p1689011600283179, in particular:
did you enable the logs exporter, e.g. otel.logs.exporter=otlp?
logs exporter will be enabled by default in the upcoming 2.x release in a few months, but for now you need to opt-in to it
@daoweili also check out this slack discussion which may be helpful in your case https://cloud-native.slack.com/archives/CJFCJHG4Q/p1689011600283179, in particular:
did you enable the logs exporter, e.g. otel.logs.exporter=otlp? logs exporter will be enabled by default in the upcoming 2.x release in a few months, but for now you need to opt-in to it https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/6f09cf79b1a18850e88897a54c1e39ef167b803a/javaagent-tooling/src/main/java/io/opentelemetry/javaagent/tooling/OpenTelemetryInstaller.java#L31-L33
yes, I enabled otel.logs.exporter=otlp
I think you can register a logback or log4j appender and set the log level on the appender - no extension needed.
Hi, I want to use the extensions for docker images, not only in a few projects.
https://cloud-native.slack.com/archives/CJFCJHG4Q/p1689011600283179 hi, I don't have this slack account
I only want to collect error logs, But the above code doesn't work properly. Do you have any better suggestions?
How does it not work properly? Can you post expected and actual output? Or, can you provide a repro scenario?
I only want to collect error logs, But the above code doesn't work properly. Do you have any better suggestions?
How does it not work properly? Can you post expected and actual output? Or, can you provide a repro scenario?
I want to collect only error logs from the SDK by extending it. But the code didn't take effect and execute properly. It still collects all levels of logs. I think the extensions code is not excute.
hi @daoweili, I think we would need a repro in order to understand your issue and and help you further
What version are you using? 1.27
Environment Compiler: openjdk 17 OS: ubuntu 16.0.4
Additional context
LogAutoConfigurationCustomizerProvider:
@AutoService(AutoConfigurationCustomizerProvider.class) public class LogAutoConfigurationCustomizerProvider implements AutoConfigurationCustomizerProvider {
}
ErrorLogBatchProcessor: public class ErrorLogBatchProcessor implements LogRecordProcessor {
}
I only want to collect error logs, But the above code doesn't work properly. Do you have any better suggestions?