Skip to content

Commit

Permalink
feat: Update Gunicorn Logging Configuration for Datadog Compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
nadeemshahzad committed Oct 8, 2024
1 parent 28fefe8 commit 2434881
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions notesserver/docker_gunicorn_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@

workers = 2

# Set the log level for Gunicorn
loglevel = 'info'

# Set access and error logs to std
accesslog = '-' # Access logs to stdout
errorlog = '-' # Error logs to stdout

# Define the custom access log format to match the Datadog pipeline format
access_log_format = '%(t)s %(l)s [%(r)s] [%(p)s] [dd.trace_id=%(o)s dd.span_id=%(O)s] "%(m)s %(U)s %(H)s" %(s)s %(b)s "%(f)s" "%(a)s"'


def pre_request(worker, req):
worker.log.info("%s %s" % (req.method, req.path))

Expand Down

0 comments on commit 2434881

Please sign in to comment.