If a script writes its own logs, the location of the log files can vary depending on preference of the scripter. I was wondering, would it be more appropiate to put the logs of this script (lets say its titled SCRIPT_NAME) in (1) the ./logs/SCRIPT_NAME/ directory, or in (2) the ./scripts/SCRIPT_NAME/logs/ directory?
I personally find it more appropriate to have it in the logs directory (1) because logs are nice to have all in one spot for everything that pertains to the Soldat Dedicated Server, especially if multiple scripts communicate with one-another, its less of a pain to find. Also, with option (2), it would make hard-linking (or similar alternative) the script a bad idea since logs from multiple servers would be written to the same location in [possibly] the same file(s).
Although, in option (1), when a server owner installs the script, they must be aware they must create the SCRIPT_NAME directory in the logs directory, or the server may spill out errors (at least until functionality of creating directories is implemented without the use of shell_exec). This could be very annoying, especially when it is a popular script, and many people are wondering why installing the script makes the server spew out errors (which may result in a decrease in script usage). Option (2) avoids this since the logs directory is already existing when installing the script.
If you have other suggestions/options and comments, feel free to add.
I decided to put the pros and cons in lists:
For (1) / Against (2)- Single location for all logs pertaining to the single Soldat server
- Script installer requires creation of script logs directory
For (2) / Against (1)- Hard-linking (or similar alternative) the script will cause for multiple servers' scripts to write logs in the same location
An aside question: How do you guys write logs? Do you put the date in the filename? Or is everything in a single file? Or do you have filenames associated to the types of logs?