Regex for excluding files from access log

Discussion in 'OpenLiteSpeed Suggestions and Requests' started by Fearless, Feb 19, 2015.

  1. Fearless

    Fearless Member

    I thought there was this option, but I guess not. From searching I think enterprise litespeed has this option (that post was back in 2007!). You can place in your rewrite the dontlog tag to exclude certain file types from being logged in your access log. Any chance that could be added to OLS? Maybe even better would be the option to log different files types to different logs. Would help a lot with clutter. Thanks.
     
  2. lsmichael

    lsmichael Active Member

    Howdy @Fearless,

    Seems you're right. I checked with the developers and it's not supported yet. We do plan to add it, though.

    Michael
     
  3. lsmichael

    lsmichael Active Member

    Howdy @Fearless,

    Well, that happened faster than I thought. We've added this to the 1.3.8 and 1.4.5 releases we're announcing today.

    Cheers,

    Michael
     
    Fearless likes this.
  4. Fearless

    Fearless Member

    Awesome news. :)
     
  5. Fearless

    Fearless Member

    The question is how do you use it? :p
    I tried adding this to test in my rewrite log: RewriteRule .* - [E=dontlog:1]
    Doesn't seem to work though. I got that from searching, but the sources are many years old so it might be something changed.
     
  6. lswave

    lswave Member

    in web admin console,
    Virtual Hosts-> select your virtual host ->Rewrite->Enable Rewrite:Yes
    then put
    RewriteRule .* - [E=dontlog:1]
    in "Rewrite Rules"

    tested working in enterprise lsws, ols should be same steps.
     
  7. Fearless

    Fearless Member

    Hmm, I did exactly that a few days ago (tested again today), but everything was still being logged. I also tried removing all other lines from my rewrites in case of any conflicts, but no luck either.

    Are you able to test OLS as well? I'm on latest CentOS if it makes a difference.
     
    lsmichael likes this.
  8. lswave

    lswave Member

    following http://open.litespeedtech.com/mediawiki/index.php/Help:Repositories
    yum install openlitespeed
    I tested ols 1.3.8

    it's half working by my test
    1. change "Debug Level" from NONE to MEDIUM
    web admin -> Server -> Log -> Debug Level: NONE to MEDIUM

    2. in error.log, can see log entry like
    2015-03-06 03:50:34.803 [DEBUG] [10.0.8.10:62013#Example] disable access log for this request.
    it shows
    RewriteRule .* - [E=dontlog:1]
    is read and parsed.

    3. but the request is still loged in access.log, as if above rewriterule not exist

    so my conclusion from above tests, it's a bug.

    4. but disable all the access log in virtual host -> Log -> Access Log -> Log Control: Disabled
    does work -- all requests no longer log in access.log
     
    Fearless and lsmichael like this.
  9. lsmichael

    lsmichael Active Member

    Fearless likes this.

Share This Page