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

[ENHANCEMENTS] HTTP access logging #218

Closed
jimsynz opened this issue Jun 26, 2024 · 8 comments
Closed

[ENHANCEMENTS] HTTP access logging #218

jimsynz opened this issue Jun 26, 2024 · 8 comments
Labels
enhancement New feature or request

Comments

@jimsynz
Copy link

jimsynz commented Jun 26, 2024

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

  • Sometimes it's hard to debug what's going on and what access rule a particular request is using
  • The request statistics are fine, but not very details

Describe the solution you'd like
I would love to have a configuration option that allows HTTP requests to be logged in the a configurable format (maybe defaulting to Apache Common Log Format or similar). That way it would be easy to view requests and where they're coming from and use tools such as https://github.com/allinurl/goaccess

Describe alternatives you've considered
I considered setting up an instance of https://plausible.io/self-hosted-web-analytics but that would involve installing a clickhouse container as well as figuring out how to inject the javascript tracking code into the proxy payload.

Additional context
N/A

@jimsynz jimsynz added the enhancement New feature or request label Jun 26, 2024
@tobychui
Copy link
Owner

Hey @jimsynz thanks for reminding me again for this feature! Yes, this feature is on my to-do list which is expected to be implemented after the load balancer.

After seeing this enhancement request I suddenly remember there were something similar before but I can't find it. Turns out, the request was made in the discussion section instead of issue.

@mbah-dukun
Copy link

+1 add capability for send to logging server

@jimsynz
Copy link
Author

jimsynz commented Jun 30, 2024

Thanks @tobychui 🙌

@DaGrooves
Copy link

I +1 👍 this request. Would be great to get the access logs into Grafana and create a Dashboard for it :)

@tobychui
Copy link
Owner

tobychui commented Jul 14, 2024

Ok I got it working. The next release will also ship with a build-in log viewer for quick debug and log view.

圖片
The format will be something like this (similar to apache, but not exactly identical as some information like total bytes transfer are not accessible while I am trying to prevent mutex in log file write)

[2024-07-14 16:18:05.431780] [router:host-http] [client 127.0.0.1] GET /script/jquery.min.js 200
[2024-07-14 16:18:05.440030] [router:host-http] [client 127.0.0.1] GET /img/system/power.svg 200
[2024-07-14 16:18:05.446178] [router:host-http] [client 127.0.0.1] GET /img/desktop/system_icon/user.svg 200
[2024-07-14 16:18:05.465306] [router:host-http] [client 127.0.0.1] GET /system/file_system/ongoing 200
[2024-07-14 16:18:05.472043] [router:host-http] [client 127.0.0.1] GET /SystemAO/locale/desktop.json 200
[2024-07-14 16:18:05.518831] [router:host-http] [client 127.0.0.1] GET /system/desktop/host 200

@mbah-dukun
Copy link

Ok I got it working. The next release will also ship with a build-in log viewer for quick debug and log view.

圖片 The format will be something like this (similar to apache, but not exactly identical as some information like total bytes transfer are not accessible while I am trying to prevent mutex in log file write)

[2024-07-14 16:18:05.431780] [router:host-http] [client 127.0.0.1] GET /script/jquery.min.js 200
[2024-07-14 16:18:05.440030] [router:host-http] [client 127.0.0.1] GET /img/system/power.svg 200
[2024-07-14 16:18:05.446178] [router:host-http] [client 127.0.0.1] GET /img/desktop/system_icon/user.svg 200
[2024-07-14 16:18:05.465306] [router:host-http] [client 127.0.0.1] GET /system/file_system/ongoing 200
[2024-07-14 16:18:05.472043] [router:host-http] [client 127.0.0.1] GET /SystemAO/locale/desktop.json 200
[2024-07-14 16:18:05.518831] [router:host-http] [client 127.0.0.1] GET /system/desktop/host 200

❤ i love this . . . . thanks

@jimsynz
Copy link
Author

jimsynz commented Jul 15, 2024

This is amazing! Thanks @tobychui

@tobychui
Copy link
Owner

Featured added in v3.0.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants