this post was submitted on 23 Feb 2025
60 points (89.5% liked)

Selfhosted

43094 readers
1093 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

I set it to debug at somepoint and forgot maybe? Idk, but why the heck does the default config of the official Docker is to keep all logs, forever, in a single file woth no rotation?

Feels like 101 of log files. Anyway, this explains why my storage recipt grew slowly but unexpectedly.

top 50 comments
sorted by: hot top controversial new old
[–] [email protected] 24 points 1 week ago (2 children)

You should always setup logrotate. Yes the good old Linux logrotate...

[–] [email protected] 35 points 1 week ago (5 children)

We should each not have to configure log rotation for every individual service. That would require identify what and how it logs data in the first place, then implementing a logrotate config. Services should include a reasonable default in logrotate.d as part of their install package.

[–] [email protected] 4 points 6 days ago

Docker services should let docker handle it, and the user could then manage it through Docker or forward to some other logging service (syslog, systemd, etc). Processes in containers shouldn't touch rotation or anything, just log levels and maybe which types of logs go to stdout vs stderr.

load more comments (4 replies)
[–] [email protected] 28 points 1 week ago (14 children)

I don't disagree that logrotate is a sensible answer here, but making that the responsibility of the user is silly.

load more comments (14 replies)
[–] [email protected] 15 points 1 week ago (12 children)

Imho it’s because docker does away with (abstracts?) many years of sane system administration principles (like managing logfile rotations) that you are used to when you deploy bare metal on a Debian box. It’s a brave new world.

[–] [email protected] 4 points 6 days ago* (last edited 6 days ago) (2 children)

I disagree with this, container runtimes are a software like all others where logging needs to be configured. You can do so in the config of the container runtime environment.

Containers actually make this significantly easier because you only need to configure it once and it will be applied to all containers.

[–] [email protected] 3 points 6 days ago (1 children)

You are right and as others have pointed out correctly it’s Nextcloud not handling logging correctly in a containerized environment. I was ranting more about my dislike of containers in general, even though I use the technology (correctly) myself. It’s because I am already old on the scale of technology timelines.

[–] [email protected] 3 points 6 days ago

Or you can forward to your system logger, like syslog or systemd.

But then projects like NextCloud do it all wrong by using a file. Just log to stdout and I'll manage the rest.

[–] [email protected] 49 points 1 week ago (3 children)

It's because with docker you don't need to do log files. Logging should be to stdout, and you let the host, orchestration framework, or whoever is running the container so logs however they want to. The container should not be writing log files in the first place, containers should be immutable except for core application logic.

[–] [email protected] 4 points 6 days ago

At worst it saves in the config folder/volume where persistent stuff should be.

[–] [email protected] 2 points 6 days ago (1 children)

Docker stores that stdout per default in a log file in var/lib/docker/containers/...

[–] [email protected] 3 points 6 days ago

You can configure the default or override per service. This isn't something containers should be doing.

load more comments (1 replies)
load more comments (10 replies)
[–] [email protected] 11 points 1 week ago (10 children)

Everything I hear about Nextcloud scares me away from messing with it.

[–] [email protected] 1 points 6 days ago

I'm considering switching to Seafile. I just need documents to sync and Collabora integration, and it seems to do both without dealing with PHP nonsense.

load more comments (8 replies)
load more comments
view more: next ›