this post was submitted on 23 Feb 2025
68 points (100.0% liked)

Selfhosted

44954 readers
457 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.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 26 points 1 month ago (2 children)

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

[–] [email protected] 34 points 1 month ago (3 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] 5 points 4 weeks 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.

[–] [email protected] 2 points 1 month ago

Ideally yes, but I've had to do this regularly for many services developed both in-house and out of house.

Solve problems, and maybe share your work if you like, I think we all appreciate it.

[–] [email protected] 1 points 4 weeks ago (1 children)

Agreed, but going container route those nice basic practices are dead.

And also, being mextcloud a php service, of can't by definition ship with a logrotate config too, because its never packaged by your repo.

[–] [email protected] 4 points 4 weeks ago (1 children)

The fact (IMHO) is that the logs shouldn't be there, in a persistent volume.

[–] [email protected] 2 points 4 weeks ago

Probably, but still, if they are, just rotate them.

[–] [email protected] 28 points 4 weeks ago (1 children)

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

[–] [email protected] 5 points 4 weeks ago (4 children)

Are you crazy? I understand that we are used to dumbed down stuff, but come on...

Rotating logs is in the ABC of any sysadmin, even before backups.

First, secure your ssh logins, then secure your logs, then your fail2ban then your backups...

To me, that's in the basic stuff you must always ensure.

[–] [email protected] 6 points 4 weeks ago (2 children)

This is a docker! If your docker is marketed as ready to go and all-in-one, it should have basic things like that.

If I were running this as a full system with a user base then of course I would go over everything and make sure it all makes sebse for my needs. But since my needs were just a running nc instance, it would make sense to run a simple docker with mostly default config. If your docker by default has terrible config, then you are missing the point a bit.

[–] [email protected] 2 points 4 weeks ago

Containers don't do log rotation by default and the container itself has no say in the matter. You have to configure it in your container runtime config.

[–] [email protected] 1 points 4 weeks ago (2 children)

Dockers images are often incoherent and just different from one a other so much that you should never give something as expected and doublecheck the basics.

Docker was never meant do deploy services, and I shows.

[–] [email protected] 5 points 4 weeks ago

It's absolutely meant to deploy services, that's its entire purpose...

[–] [email protected] 3 points 4 weeks ago

What? Like, yeah you are responsible to do your own checks, sure. but the fuq you said about docker?

[–] [email protected] 5 points 4 weeks ago (1 children)

Logration is the abc of the developer.
Why should I need 3rd party tools to fix the work of the developer??

[–] [email protected] 5 points 4 weeks ago (2 children)

Why is that? Really? The Dev should replace a system function? And implement over and over again the same errors when logrotate exist?

[–] [email protected] 3 points 4 weeks ago (1 children)

Yes, that’s exactly what we’re arguing here. The developer also should replace autotools/cmake, git, … Don’t be daft! Packaging sane defaults for logrotate is now replacing a system function?

[–] [email protected] 2 points 4 weeks ago

Docker is supposed to run a single process Logrotate is a separate process. So unless the application handles rotating logs, the container shouldn't handle it.

[–] [email protected] 1 points 4 weeks ago

Is it default on every distro? If not, then it's the responsibility of the dev.

[–] [email protected] 5 points 4 weeks ago

I would argue that logrotate was the ABC of any sysadmin in 2005, but today that should be a solved problem, whether in docker or bare metal.

[–] [email protected] 2 points 4 weeks ago (1 children)

Those should also all be secure by default. What is this, Windows?

[–] [email protected] 2 points 4 weeks ago

Just basic checks I prefer to ensure, not leave to distribution good faith. If all is set, good to go. Otherwise, fix and move on.

Specially with self hosted stuff that is a bit more custom than the usual.