piped-logger for error-log too?

ts77

Well-Known Member
#1
one feature I missed in apache or other webservers too ... would it be possible to log error-log to a piped logger too (lines prefixed with the vhost/hostname) ?
 

ts77

Well-Known Member
#3
LOL, ok ... lets ask this way.
does the common-error-log the server writes to contain the host the error is coming from too?
That would be something really important if you only write to one error-log.

An important point for me would be the automatic rotation of the error-log if I write to a piped logger (cronolog). but thats implemented from you already ;).
Another thing would be to have the same options and possibilities to work with the error-log like with the access-log.
 

mistwang

LiteSpeed Staff
#4
rotate litespeed log file is as easy as "mv error.log ...", no need for a piped logger, same is true for access log. Piped logger is useful for acess logging because some one might want to log in a DB or something else.

We will add virtual host name in error log in next release. It is a good point.
 

ts77

Well-Known Member
#5
ok, here is some more stuff about logging and piped-logger.
I've looked at the docs but couldn't find anything about it.
Please point me to the documentation if thats explained there.

So, here are my feature requests:
- support for command-line options for the piped logger
(i.e. I would need to run /usr/sbin/cronolog /home/dir/cronolog-lsws/%Y/%m/%d/access.log ... how should I do this now?)
- why does a piped-logger need an "address" in the external applications screen? or why "max connections" ?

- support for rotating only by day (currently I can only rotate by size if I'm not mistaken)
- support for running a post-rotate script (i.e. for our own webalizing-software)
 

mistwang

LiteSpeed Staff
#6
- support for command-line options for the piped logger
(i.e. I would need to run /usr/sbin/cronolog /home/dir/cronolog-lsws/%Y/%m/%d/access.log ... how should I do this now?)
The server itself can take command-line options, but the web admin interface won't allow you to add any right now, will be fixed. You can change the configuration file directly.
Even command line options are supported, lsws still don't have any idea about how to populate "%Y/%m/%d", and we have no intension to add those kind of marco support.


- why does a piped-logger need an "address" in the external applications screen? or why "max connections" ?
Right now "address" has no effect for logger, but it is required for other external apps, we may make it optional in the future. In the future we can support piped-logger running on another machine via socket.

As to "max connections", it is useful when the traffic is so high or the logger is so slow (like logging into DB), a single logger cannot keep up with, as LSWS always stay in non-blocking mode, so in order to prevent internal logging buffer overflow, LSWS can start additional loggers on demand. LSWS always keep the number of loggers as low as possible.

- support for rotating only by day (currently I can only rotate by size if I'm not mistaken)
- support for running a post-rotate script (i.e. for our own webalizing-software)
Just do it in a cron job, unlike with other web server, you can always rotate the log manually whenever you want, LSWS can detects it and create a new log file. Thus you can run your post-rotate script after the rotation.
If you want to run the log analyizer yourself, rotate the log file youself. :)
 

ts77

Well-Known Member
#7
mistwang said:
The server itself can take command-line options, but the web admin interface won't allow you to add any right now, will be fixed. You can change the configuration file directly.
Even command line options are supported, lsws still don't have any idea about how to populate "%Y/%m/%d", and we have no intension to add those kind of marco support.
How are command-line options supported here?

I get this after adding my command-line options to the path in httpd_config.xml
Code:
[config:server:epsr:cronolog-lsws] invalid path - /usr/sbin/cronolog /home/dir/cronolog-lsws/%Y/%m/%d/access.log, it cannot be started by Web server!
Any way to solve this?
 

ts77

Well-Known Member
#11
just as a follow-up.

The piped logger I told above works now (with 2.0.1) for the access-log with all the command-line options required :).

Thanks a lot.
 

mistwang

LiteSpeed Staff
#12
You are welcome. :lol:

I think it is better to avoid the piped logger when possible to get the best performance, if performance is the biggest concern, still a lot of overhead involved. :)
 

ts77

Well-Known Member
#13
Once I feel like rewriting my statistics-workflow I may consider using the internal logging.
But until then its just good to be able to use (nearly) the same mechanism as before.
 
Top