Huge Log on Release Build


#1

Hello,
We built the Ubuntu release version 8000. It generates enormous log files every week like 21 gigs. How do we minimize the logging?


#2

@Spinteractive is that with Interface or a Server?
I’m gonna assume that’s with interface since we had a bug that caused the interface not to cleanup old logs properly.
A fix for that bug went into 8233, so I’d suggest updating to the latest version to fix that issue.


#3

No, it’s the server logs.
Is there a switch to turn on/off during compile to disable all the logging? It’s logging everything, about 21+GB per week.


#4

@Spinteractive can you describe your setup to me?
Our server components don’t save any logs to disk by default unless you are using the Sandbox.
But the Sandbox should be cleaning up after itself. However I don’t think it’s been tested on linux, so there might be a platform related bug.

But if you are just manually running the bare server components, then that means a third party program is collecting those logs.


#5

it’s the domain-server.log filling us up.
Here’s a link to a partial file: https://drive.google.com/open?id=1KPSea5S4dR42nuPjmmWmQDYzWGur0qIH

Here are the instructions on compiling with logging from your docs. How do we disable or turn off?

sudo su
mkdir -p /var/log/hifi/

cat > /etc/systemd/system/domain-server.service <<EOF
[Unit]
Description=Domain Server service for High Fidelity
After=network.target
[Service]
Restart=on-failure
WorkingDirectory=/home/hifi/hifi/build/domain-server
ExecStart=/bin/bash -c ‘ulimit -c unlimited; /home/hifi/hifi/build/domain-server/domain-server 2>&1 >> /var/log/hifi/domain-server.log’
[Install]
WantedBy=multi-user.target
EOF

cat > /etc/systemd/system/assignment-client.service <<EOF
[Unit]
Description=Assignment client service for High Fidelity server
After=network.target
PartOf=assignment-clients.target
[Service]
Restart=always
Environment=“LD_LIBRARY_PATH=/home/hifi/hifi/build/ext/makefiles/nvtt/project/lib/”
WorkingDirectory=/home/hifi/hifi/build/assignment-client
ExecStart=/bin/bash -c ‘ulimit -c unlimited; /home/hifi/hifi/build/assignment-client/assignment-client -n7 2>&1 >> /var/log/hifi/assignment-client.log’
[Install]
WantedBy=assignment-clients.target
EOF


#6

I see, the issue is basically those 2 lines.

What >> basically means is that it’ll keep appending to the file forever.
You could change it to > to override the file the file every time, that would fix your log size issue.

So you’d have that instead:

ExecStart=/bin/bash -c ‘ulimit -c unlimited; /home/hifi/hifi/build/domain-server/domain-server 2>&1 > /var/log/hifi/domain-server.log’
[…]
ExecStart=/bin/bash -c ‘ulimit -c unlimited; /home/hifi/hifi/build/assignment-client/assignment-client -n7 2>&1 > /var/log/hifi/assignment-client.log’

This won’t conserve log files from old runs though, for any more complex behavior, you’d have to use some third-party log management tool or write something up yourself.