I have a dotnet core application that is executed by a systemctl service. In normal operation it will always execute in this context. However the application may also be executed manually by the user so they can see debug statements sent to the console. I have observed that the console output is also sent to daemon.log and syslog. The application is monitoring external events and may generate a lot of messages and in a couple of instances it has filled up the SD card. I have tried to disable the output by adding the following to the service unit file:
[Service] StandardError=null StandardOutput=null
This seems to prevent the application from writing to the daemon and syslog logs. My question is - is this advisable and are there other places I need to worry about. I am a bit of a linux noob so I am still picking up these pitfalls.
Long term I will need to update the application's internal logging but is this approach make sense overall?