I have an upstart service that it fills up the space. I need to move the logs from /var/log/upstart to a different directory /pub/data/logs/order_server. I tried to do it using
console log --logdir /pub/data/logs/order_server
but it gives an error
start: Unknown job: order_server
checking the file
$ init-checkconf /etc/init/order_server.conf
ERROR: failed to ask Upstart to check conf file
The story is similar to this one. I ended up doing the hack exec /path/to/my/daemon --arg1 --arg2 >/mnt/log/XYZ 2>&1
as someone suggested.
The following is the service conf file
# Ubuntu upstart file at /etc/init/order_server.conf
description "order server dev version"
start on (local-filesystems and net-device-up)
stop on runlevel [06]
respawn
respawn limit 10 5
exec /pub/integration_prod/integration/order_server.sh >> /pub/data/logs/order_server/order_server.log 2>&1
Now the log file location is changed to the new location but getting it difficult to rotate the logs. The log file gets zipped up but a new log file is not created.
the upstart rotation looks something like this
/var/log/upstart/*.log /pub/data/logs/order_server/order_server.log {
daily
missingok
rotate 3
compress
notifempty
nocreate
}
My initial intention is to fix it by using the console log option as suggested here. I hope someone can help.