You should always setup logrotate. Yes the good old Linux logrotate...
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.
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.
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.
The fact (IMHO) is that the logs shouldn't be there, in a persistent volume.
Probably, but still, if they are, just rotate them.
I don't disagree that logrotate is a sensible answer here, but making that the responsibility of the user is silly.
for some helpful config, the below is the logging config I have and logs have never been an issue.
You can even add 'logfile' => '/some/location/nextcloud.log',
to get the logs in a different place
'logtimezone' => 'UTC',
'logdateformat' => 'Y-m-d H:i:s',
'loglevel' => 2,
'log_rotate_size' => 52428800,
Everything I hear about Nextcloud scares me away from messing with it.
Just use the official Docker AIO and it is very, very little trouble. It's by far the easiest way to use Nextcloud and the related services like Collabora and Talk.
The ~~price rboem~~ problem is that the log file is inside the container in the www folder.
Edit: typo
You can move it.
Right, I should probably map the file directly to the system log folder. I'll try that.
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.
I stopped using Nextcloud a couple of years ago after it corrupted my encrypted storage. I'm giving it a try again because of political emergency. But we sure need a long term replacement. Written in Rust or some other sane language.
Nc is great, it really is amazing that it is foss. Sure it isn't the slickest or fastest, and it does need more maintenance than most foss services, but it is also more complex and has so many great features.
I really recommend nc, 99% of the time it just works for me. It just seems that their docker was done pretty poorly imo, but still it just works most of the time.
I've considered writing my own, but it's a ton of work. Even for my very basic use case of a file browser that offloads all edits to Collabora CODE. I had a basic system started in Go some years back, but bailed when I got a basic setup working (just file ops).
Maybe I'll give it a shot again. I mostly use Rust now, and I'm kind of stalling on my P2P Lemmy idea anyway. I really don't like PHP and I don't use many of the Nextcloud features anyway. I just want Google Drive w/ LibreOffice or OnlyOffice.
My NC setup "just works" though. So I'm not super motivated to replace it.
Edit: looks like Seafile may do the trick.
Reminds me of when my Jellyfin container kept growing its log because of something watchtower related. Think it ended up at 100GB before I noticed. Not even debug, just failed updates I think. It's been a couple of months.
Well that's not jellyfins faults but rather watchtower...
Is there a tool to automatically check partitions for excessive log files, caches or other junk? The root partition of a Linux box I have is 60 GiB and almost full, and XFCE will fail to start when there's no space. I would use WinDirStat on Windows but the Linux alternatives can't do the job properly because they scan by file tree and some subdirectories of /
are on other partitions because of symlinks... I guess I could boot a live USB and mount my ext4 root partition but not the NTFS storage one but I'd rather avoid that.
Wow, thanks for the heads up! I use Nextcloud AIO and backups take VERY long. I need to check about those logs!
Don't know if I'm just lucky or what, but it's been working really well for me and takes good care of itself for the most part. I'm a little shocked seeing so many complaints in this thread because elsewhere on the Internet that's the go-to method.
It can be fidgety, especially if you stray from the main instructions, generally I do think it's okay, but also updates break it a bit every now and again.
Yeah, anything that involves a bunch of ~~complicated relationship interaction between~~ PHP scripts I just don't mess with too much.
Right now I'm hosting it through Docker on top of OpenMediaVault which is hosted on Proxmox.
If an update absolutely borks NextCloud and for some reason its BorgBackup function doesn't work, I can at least hope to count on the ProxMox snapshot of the whole volume!
And besides that, I don't actually store anything essential in NextCloud's volume itself. It's all an external mount that I could browse with any file explorer, so worst case, I'd just lose a lot of convenience. :p
101 of log files
is to configure it yourself
Look, defaults are a thing and if your defaults suck then you've made a mistake and if your default is to save a 100GB of log file in one file then something is wrong. The default in Dockers should just be not to save any log files on the persistent volumes.
Exactly. It should just write to stdout and let whatever is running it manage it.
Selfhosted
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:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
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.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!