Forum Discussion

Ryanne_Frost_76's avatar
Ryanne_Frost_76
Icon for Nimbostratus rankNimbostratus
Jan 18, 2006

help logging to local3

Hi Everyone, I'm trying to set up an iRule that logs Http request to the local3 facility.

 

Is there any changes I have to make to the syslog-ng.conf file for this to happen? my iRule works fine if I log to a differnt facility, like local 0. The reason I ask is that the directories/destination of the local 3 logs does not even exist. So perhaps there is some set up work to do if one wants to use this facility

 

 

Any help would be greatly appreciated!

 

 

Thanks

 

 

Ryanne
  • Actually, I can't seem to log to anything excpet local0

     

     

    Can anyone help?

     

     

    Ryanne

     

  • By default all other log facilities are setup to log a level of info and above. debug which is the default level when not speified in the log command, is not turned on for those facilities.

     

     

    You have a few options.

     

     

    1) Manually specify a level in your log statement

     

     

    log [.]

     

    facility: local0, local1, local2, etc

     

    level: debug (default), info, emerg

     

     

     

    Your code more than likely looks like this:

     

     

    when HTTP_REQUEST {
      log local3. "I'm logging something!"
    }

     

     

    You'll notice that the level is omitted and thus defaulting to debug. You can specify info which should make it to all the other pre-defined facilities.

     

     

    when HTTP_REQUEST {
      log local3.info "I'm logging something!"
    }

     

     

    2) Modify the syslog-ng configuration. I can't give you advice here because that falls outside of the support realm of devcentral. Feel free to look at that configuration file on your system and copy what's done for the local0 filter. Just make sure you backup the original configuration in case you get into problems.

     

     

    -Joe
  • Thanks for the reply,

     

    however, even adding info, it is still not logging

     

     

     

    Here is my irule

     

    when HTTP_REQUEST {

     

    set curtime [clock seconds]

     

    set formattedtime [clock format $curtime -format {%d/%b/%Y:%T %z}]

     

    set log_format "[IP::client_addr] - - \[$formattedtime\] \"[HTTP::method] [HTTP::uri] HTTP/[HTTP::version]\""

     

    }

     

    when HTTP_RESPONSE {

     

     

    log local2.info "$log_format [HTTP::status]"

     

    }

     

     

     

    just as a note, as I mentioned earlier, if I change local2.info , to just local0...it works as expected

     

     

    Thanks!

     

     

    Ryanne
  • First of all are you sure you are looking at the correct log file for local2? In my setup, the default is /var/log/gtm.

     

     

    This must be a syslog-ng configuration issue. Try digging around in the /etc/syslog-ng/syslog-ng.conf file and see what's different between local2 and local0. I'm running 9.2.2 and all the log facilities are working for me when I specify info as the level. It very well could be that if you have a pre-9.2.2 version before GTM was released, the local2 facility is disabled.

     

     

    Unfortunately, you are going to have to get your hands dirty with the configuration files on this one. If you are still running into problems, you might have to contact Product Technical Support.

     

     

    -Joe

     

  • rfrost, it looks like you are logging and formating it like you would see in a webserver access_log; if you don't mind sharing, is this what you are doing and are you doing this to record stats on your webservers? I am trying to get the same logging format so I can import the logs into webalizer, just wondering if you are doing the same and if you have been successful in doing so.

     

     

    Regards,

     

    -L