Forum Discussion

Algebraic_Mirror's avatar
Algebraic_Mirror
Icon for Cirrostratus rankCirrostratus
Nov 10, 2017

iRulesLX Logging Not Working - No log statements appear in /var/log/ltm

I am using iRulesLX, and I'm trying to troubleshoot the webpage my node.js code is producing. To do so, I tried to use logging statements as referenced in this DevCentral article series, but have found they aren't working.

Specifically, I am trying to use statements like these:

 

console.log("Log message.");
console.error("Error message.");

 

According to what I've read, STDOUT and STDERR for node.js should be going to /var/log/ltm, and those are the statements you want to use. However, when I look at /var/log/ltm, I don't see any of my log statements. I am trying to figure out how to get them to be logged.

Other important background info / things I've tried:

  1. This is 12.1, so the feature in 13 that allows you to redirect logs to a different file doesn't exist here. Everything must go to /var/log/ltm in this version, but my log statements aren't there.

  2. I have grep'ed the entire /var/log directory, and confirmed my statements aren't show up in any of the other log files.

  3. I've change my DB variables to support logging, like so:

     

    sys db log.sdmd.level {
        value "debug"
    }

     

     

    sys db log.sdmd.stdout {
        value "enable"
    }

     

  4. I've tried restarting the sdmd process.

  5. I've tried reloading/restarting the plugin.
  6. I've tried a reboot.

None of these things have helped. And I know for a fact my node.js code is running, because it generates the page it is supposed to and I can see it in my browser (the page is slightly wrong, hence the troubleshooting, but I know the code is running). TCL log statements I put before and after the ILX::call command also show up in the /var/log/ltm just fine, so it is really just node.js log statements that won't appear in my log.

Any ideas or help would be much appreciated.

3 Replies

  • Same problem here, but only on my 13.0.0 VE system. I haven’t found a solution either. As a workaround I use the node.js fs module and write logs to a file. However on another hardware appliance the console.log function works like it should.

     

  • I'm seeing similar behavior, actually. I've seen the logging work in v13 (I think it was a VE in a cloud instance, so not necessarily hardware, but maybe different than this VE), so on some devices it works, but in this VE it just doesn't. I have no idea why it works on some devices but not others. I guess I'll have to try opening a support case.

     

  • Got the answer to this. The issue was a custom log filter, custom log publisher, and custom logging destination. I didn't initially realize I had any of those, because on the box I was working on (which was not one I originally set up) there was no customized logging in the Common partition. But it turns out there was another partition on the box, and it had all those custom logging objects in it.

     

    The log filter was set to "all sources", and the level was set to "info", meaning it was grabbing all logs that were the level of info or above. The publisher and destination objects were sending them out to a remote Splunk server (that no longer even exists, ironically), and "local-syslog" was not in the list of destinations in the publisher object, meaning no copies of the log statements were being stored locally.

     

    So in effect, nearly every log on my box (unless it was debug level, or something coded to write directly to the log like certain TCL log commands) was getting shipped out to nowhere, and that included all the iRulesLX logs. Once I added "local-syslog" as a destination in the publisher, they all started showing up.

     

    So hopefully this will help someone else... watch for logging objects in partitions other than Common!