Log rotate (access_logs) #56

Closed
opened 2025-12-29 09:22:14 +01:00 by adam · 6 comments
Owner

Originally created by @ragchuck on GitHub (Apr 15, 2025).

My access.log is already quite large, are there any plans to implement log rotate solution?

https://caddyserver.com/docs/caddyfile/directives/log#file
https://github.com/natefinch/lumberjack

Originally created by @ragchuck on GitHub (Apr 15, 2025). My access.log is already quite large, are there any plans to implement log rotate solution? https://caddyserver.com/docs/caddyfile/directives/log#file https://github.com/natefinch/lumberjack
adam added the enhancement label 2025-12-29 09:22:14 +01:00
adam closed this issue 2025-12-29 09:22:14 +01:00
Author
Owner

@yusing commented on GitHub (Apr 15, 2025):

Planning to do so, I have these skeleton code quite long time ago: https://github.com/yusing/godoxy/blob/main/internal/net/gphttp/accesslog/rotate.go.
https://github.com/yusing/godoxy/blob/main/internal/net/gphttp/accesslog/retention.go

I'll implement it asap.

@yusing commented on GitHub (Apr 15, 2025): Planning to do so, I have these skeleton code quite long time ago: https://github.com/yusing/godoxy/blob/main/internal/net/gphttp/accesslog/rotate.go. https://github.com/yusing/godoxy/blob/main/internal/net/gphttp/accesslog/retention.go I'll implement it asap.
Author
Owner

@yusing commented on GitHub (Apr 18, 2025):

Hey, I've implemented log rotation (92a11648b0572f91a39febb4d9dfa1f9693f392c). If you're interested please try it on nightly image.

@yusing commented on GitHub (Apr 18, 2025): Hey, I've implemented log rotation (92a11648b0572f91a39febb4d9dfa1f9693f392c). If you're interested please try it on `nightly` image.
Author
Owner

@ragchuck commented on GitHub (Apr 22, 2025):

@yusing maybe you could give me a hint how to configure this?

I updated my tag to nightly and added this to config.yml:

# config.yml
  access_log:
    format: combined
    path: /app/logs/access.log
    retention:
      keep_size: 10M

But the log doesn't seem to be rotated...

@ragchuck commented on GitHub (Apr 22, 2025): @yusing maybe you could give me a hint how to configure this? I updated my tag to `nightly` and added this to config.yml: ```yml # config.yml access_log: format: combined path: /app/logs/access.log retention: keep_size: 10M ``` But the log doesn't seem to be rotated...
Author
Owner

@yusing commented on GitHub (Apr 22, 2025):

The nightly is currently on an OIDC fix patch. Sorry but you'll have to wait before next version releases.

The syntax will be like this:
retention: <value>

Available values:

  • {N} [days|weeks|months]
  • last {N}: last N lines
  • {N} [KB|MB|GB|Kb|Gb|Mb]
@yusing commented on GitHub (Apr 22, 2025): The nightly is currently on an OIDC fix patch. Sorry but you'll have to wait before next version releases. The syntax will be like this: `retention: <value>` Available values: - `{N} [days|weeks|months]` - `last {N}`: last N lines - `{N} [KB|MB|GB|Kb|Gb|Mb]`
Author
Owner

@ragchuck commented on GitHub (Apr 22, 2025):

got it! thanks!

@ragchuck commented on GitHub (Apr 22, 2025): got it! thanks!
Author
Owner

@yusing commented on GitHub (Apr 25, 2025):

v0.11.0 is out :)

@yusing commented on GitHub (Apr 25, 2025): v0.11.0 is out :)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/godoxy#56