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 support for logback-access or logback-core library #12597

Open
railsharipov opened this issue Nov 8, 2024 · 0 comments
Open

Add support for logback-access or logback-core library #12597

railsharipov opened this issue Nov 8, 2024 · 0 comments
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request

Comments

@railsharipov
Copy link

railsharipov commented Nov 8, 2024

Is your feature request related to a problem? Please describe.

Request logs are not exported when instrumenting DropWizard application. DropWizard uses logback-access library for request logging which is independent of logback-classic.

I am running Dropwizard app with OTel Contrib Java agent. I am running agent with default config, I have otlp log export enabled. I do see logs from application loggers (logback) but no server request logs.

Please see this discussion: #12588

Describe the solution you'd like

Add support for exporting request logs from DropWizard application.

Describe alternatives you've considered

I have tried using classic request logging: https://www.dropwizard.io/en/release-2.1.x/manual/configuration.html#classic-request-log

The classic request log uses the logback-classic library for processing request logs. It produces logs only in the standard NCSA common log format, but allows to use an extended set of appenders.

Dropwizard HTTP server config I have tried:

server:
  requestLog:
    type: classic
    timeZone: UTC
    appenders:
      - type: console

But request logs are still not getting exported.

Additional context

Here is my Dropwizard HTTP server config:

server:
  type: simple
  ...
  gzip:
    bufferSize: 8KiB
    enabled: true
    minimumEntitySize: 128B
    deflateCompressionLevel: 9
  requestLog:
    appenders:
      - type: console

Here is my Dropwizard logging config:

logging:
  level: INFO
  loggers:
    ...
  appenders:
    - type: console
      threshold: TRACE
      timeZone: "UTC"
      logFormat: ...

Here is the docker image I use to run app:

FROM amzn-corretto:17-alpine
...
ENV OTEL_LOG_LEVEL=error
ENV OTEL_JAVAAGENT_LOGGING=simple

ENV OTEL_LOGS_EXPORTER=otlp
ENV OTEL_EXPORTER_OTLP_LOGS_ENDPOINT=http://otlp.example.com/v1/logs
ENV OTEL_EXPORTER_OTLP_LOGS_PROTOCOL=http/protobuf

ENV OTEL_SERVICE_NAME=example

CMD exec java \
    -javaagent:opentelemetry-javaagent.jar \
    -jar /opt/example/example-shadow.jar server /etc/example/config.yml

DropWizard version:

dropwizardVersion = "2.1.0"
@railsharipov railsharipov added enhancement New feature or request needs triage New issue that requires triage labels Nov 8, 2024
@trask trask added contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome and removed needs triage New issue that requires triage labels Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants