piped-logger for error-log too?

Discussion in 'Feedback/Feature Requests' started by ts77, Mar 20, 2005.

  1. ts77

    ts77 Well-Known Member

    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) ?
  2. mistwang

    mistwang LiteSpeed Staff

    We don't do that beacuse we could not think of a compelling reason for this feature. If you can convince us, we will add it. :)
  3. ts77

    ts77 Well-Known Member

    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.
  4. mistwang

    mistwang LiteSpeed Staff

    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.
  5. ts77

    ts77 Well-Known Member

    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)
  6. mistwang

    mistwang LiteSpeed Staff

    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.

    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.

    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. :)
  7. ts77

    ts77 Well-Known Member

    How are command-line options supported here?

    I get this after adding my command-line options to the path in httpd_config.xml
    [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?
  8. mistwang

    mistwang LiteSpeed Staff

    Looks like there are something need a fix in the server as well, will be fixed in next release.

    Thank you. :)
  9. ts77

    ts77 Well-Known Member

    I always love to give you more work to do ;).

    any *rough* eta for the next version?
  10. mistwang

    mistwang LiteSpeed Staff

    In this week. :)
  11. ts77

    ts77 Well-Known Member

    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.
  12. mistwang

    mistwang LiteSpeed Staff

    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. :)
  13. ts77

    ts77 Well-Known Member

    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.
  14. tomaz

    tomaz New Member

    rotating logs

    So no need for kill -HUP/USR tricks? Doesn
  15. mistwang

    mistwang LiteSpeed Staff

    that's correct.

Share This Page