Logs: Rotation, Management & External Applications

#1
I have a couple of requests to improve log management.

My first request is pretty simple. Presently, there's no way to stop the server from rotating its error log when LiteSpeed restarts (presumably to give a clean copy to the Web UI). Could you please add an option (Yes/No - Rotate Log on Restart?) to disable this behaviour? It would make it consistent with virtual host error logs and easier to manage with log management tools like logrotate.

Also, presently there's no way to manage external application errors. PHP LSAPI errors go to the server error log but Ruby LSAPI errors go to stderr. I can't make them go to one log or to a virtual host's error log. This is especially important in a shared hosting environment, because the site admin (me, in this case) needs to get involved in each company's debugging woes. I have two possible solutions for this.

The first is to change the current behaviour so that errors from an external application also go to any virtual host which uses it as a script handler or in a context. By adding the errors to a virtual host log instead of the server, site admins don't need to be involved in debugging and the client has one file of errors (for both the host and its applications).

The second, and the more interesting (I think), is to add logging options to external applications themselves. By separating applications from hosts just as hosts are from the server, you isolate errors to a single file, simplify the debugging process for clients, and simplify permission schemes for site admins. The interface could be very basic (defaults to server error log or write to its own file) or more complex (server, its own file, 'associated vhosts', or selected vhosts).

I think quite a few people, especially the Ruby on Rails community, would enjoy these two additions.

Anyway, please keep up the good work, chaps. I like the new interface for the 3.0 beta and the quick turnaround of fixes lately. It's a pleasure to upgrade LiteSpeed and find it more stable and usable each time.

- Mathew Abonyi
 

mistwang

LiteSpeed Staff
#2
Thank you for those suggestions.

Could you please add an option (Yes/No - Rotate Log on Restart?) to disable this behaviour?
Yes, it is possible. We will add that into 3.0 official release.

The first is to change the current behaviour so that errors from an external application also go to any virtual host which uses it as a script handler or in a context. By adding the errors to a virtual host log instead of the server, site admins don't need to be involved in debugging and the client has one file of errors (for both the host and its applications).
How server/virtual host log work in LSWS is that a vhost can be configured to log to its own log or just server log, when log to its own log file, all log messages will go into server log as well.

The second, and the more interesting (I think), is to add logging options to external applications themselves. By separating applications from hosts just as hosts are from the server, you isolate errors to a single file, simplify the debugging process for clients, and simplify permission schemes for site admins. The interface could be very basic (defaults to server error log or write to its own file) or more complex (server, its own file, 'associated vhosts', or selected vhosts).
Standalone stderr log file for each external application is over kill to me, log everything to the vhost log is a more practical solution.

Right now, the only part need to be improved is ruby LSAPI, to make it is possible to log STDERR into the vhost log file in stead of stderr.log.

What do you think?
 
Last edited:
#3
An environment variable like "LS_LOG_NO_ROTATE" is prefered solution.
Sounds perfect. That should be easy to add to init scripts.

Standalone stderr log file for each external application is over kill to me, log everything to the vhost log is a more practical solution.
Yes, standalone log files could be overkill. Logging to vhost is just as good. But when you say log everything, do you mean server level applications too? For example, if you have a server-level lsphp-5 external application and server-level 'php' script handler, could errors on example.com/buggy.php also go to example.com's error logs? That would be slick.

Right now, the only part need to be improved is ruby LSAPI, to make it is possible to log STDERR into the vhost log file in stead of stderr.log.
LS_LOG_NO_ROTATE and Ruby LSAPI stderr to error for right now would be superb additions.
 

mistwang

LiteSpeed Staff
#4
Quote:
An environment variable like "LS_LOG_NO_ROTATE" is prefered solution.
Sounds perfect. That should be easy to add to init scripts.
We find a better solution to have it controled via configuration file.

Yes, standalone log files could be overkill. Logging to vhost is just as good. But when you say log everything, do you mean server level applications too? For example, if you have a server-level lsphp-5 external application and server-level 'php' script handler, could errors on example.com/buggy.php also go to example.com's error logs? That would be slick.
That's correct.
 
Top