I would like my app to write logs to an application log file, managed by the built in OS syslog.
Logs appear to be in the var/log/[application] folder. But how to create one that is automated and how to write to it?
Xojo includes the system and debug but neither is appropriate for what I am looking for at the moment; I would be better off having them in separate folders (there are 3 different apps). I tried writing my own logs but they can get large quickly since they are not managed.
How to you read them without using my app? Normally I use Webmin. I also would like to sort by app, and type (like TRACE, EXCEPTION, WARNING etc). Right now, there are 3 apps and each has it own set of logs. How can I emulate that with the System.log?
How are you planning on distributing your app on Linux?
I use a TGZ file created with the -P (upper case P) option so that the full path is retained. I then put everything where it needs to be on my system and create the TGZ file from those locations (including /var/log/tolisgroup/ with proper permissions of 766). When the user installs using “sudo tar -xzPvf theBundle.tgz”, all of the files are placed where they need to be with owner, group, and permissions intact.
Is it possible for you to use a hybrid of my mechanism and preinstall on your Pi’s volume? In other words -
Create a folder on your build test system of /var/log/myApp
Set the permissions to 766
Set up your app to access /var/log/myApp/myApp.log
Prep a master with your environment installed
Make sure the environment is cleaned of any test data
Use “sudo tar -czPvf myMasterBundle.tgz /path1 /path2 /path3 …” to create the installer
When you prep the user’s system, you execute the reverse to install it:
sudo tar -zxPvf myMasterBundle.tgz
That’s essentially what I do now. The problem is, there is no log rotation. They can grow uselessly and outlandishly. So using the OS’s built in log rotation makes a lot of sense. My issue is how to do that AND keep them all separated!