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

Request logger #17

Merged
merged 7 commits into from
Dec 4, 2024
Merged

Request logger #17

merged 7 commits into from
Dec 4, 2024

Conversation

lmangani
Copy link
Collaborator

@lmangani lmangani commented Dec 3, 2024

Adds two ENV variables for testing with debug and syslog output:

  • DUCKDB_HTTPSERVER_DEBUG
  • DUCKDB_HTTPSERVER_SYSLOG

Potential solution driver for #16

# DUCKDB_HTTPSERVER_DEBUG=1 DUCKDB_HTTPSERVER_FOREGROUND=1 ./build/release/duckdb
v1.1.3 19864453f7
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D SELECT httpserve_start('0.0.0.0', 8123, '');
[2024-12-03 17:03:16] POST / - 200 - from xxxxxx:63795
[2024-12-03 17:03:21] POST / - 200 - from xxxxxx:63796

syslog

# DUCKDB_HTTPSERVER_SYSLOG=1 DUCKDB_HTTPSERVER_FOREGROUND=1 ./build/release/duckdb
# tail /var/log/syslog
2024-12-03T17:48:28.886512+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64215
2024-12-03T17:48:29.083374+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64215
2024-12-03T17:48:32.788998+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64215
2024-12-03T17:48:33.277387+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64219
2024-12-03T17:48:33.427904+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64219
2024-12-03T17:48:33.616345+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64219
2024-12-03T17:48:33.800700+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64219
2024-12-03T17:48:34.000172+00:00 localhost duckdb-httpserver[380711]: POST / - 200 - from xxxxxx:64219

untested sketch for logger hook. ideally we should provide options to pipe into a file and/or insert into a table, etc.
@lmangani lmangani marked this pull request as ready for review December 3, 2024 17:50
@lmangani lmangani changed the title WIP: Request logger Request logger Dec 4, 2024
@lmangani lmangani merged commit be1356b into main Dec 4, 2024
28 checks passed
@lmangani lmangani deleted the request-logger branch December 4, 2024 19:57
@lmangani lmangani mentioned this pull request Dec 15, 2024
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.

1 participant