High verbose set at console effects the logger file “Full” – Why is that?

Home » Asterisk Users » High verbose set at console effects the logger file “Full” – Why is that?
Asterisk Users 14 Comments

Hi everyone,

I am playing around with Asterisk 1.8.8.0 from Digium repository. This is
all there is to my logger.conf file:

*[general]*
*dateformat=%F %T*
*
*
*[logfiles]*
*full => notice,warning,error,debug,verbose,dtmf,fax*
*
*
However, when I do, “core set verbose 0” at CLI, Asterisk ceases to write
to /var/log/asterisk/full file for some reason. When I type “core set
verbose 9″ at CLI then it starts writing to /var/log/asterisk/full. Is this
the correct behaviour or am I missing a config setting?

Of course I want the /var/log/asterisk/full file to always keep the logs
regardless of what the verbosity at CLI level is.

Thanks

14 thoughts on - High verbose set at console effects the logger file “Full” – Why is that?

  • If you want to stop stuff from going to the console you can use the command “logger mute” and console will not get output but log file will.

  • Okay, but I thought that the line “console =>” is supposed to be for CLI
    and the line “Full =>” is supposed to be for the file
    /var/log/asterisk/full.

    Why would the “Full =>” be effected by “core set verbose 0”? Is this just
    bad assumption on the part of the developers? I would only assume that
    “core set verbose 0” should only effect what I see at CLI level and not at
    my my /var/log/asterisk/full log file.

    Am I missing something?

    Thanks for the feedback.

  • Yes, you are missing the fact that the verbose setting controls what level of output will be generated in the first place. You can raise and lower the amount of stuff logged/printed on CLI.

    The lines in logger.conf control what types of lines go to which place.

    One can set the verbose level as well as the debug level. These control how much log information is generated at all not where it is being written.

  • will keep it always at certain verbose level regardless of what command I
    issue at CLI?

    You see the problem I have is that Fail2ban reads the asterisk “full” log
    file. So, if I am playing on the CLI and then do “core set verbose 0” and
    exit the box and forget to set it back to 9 then Fail2ban stops working
    because the log file hasn’t logged the attack.

    I still think there is a way around this and I am missing a config. Why
    would anyone tie security logs to a mere CLI command?

    Thanks again

  • So, based on what you are saying if I issue the command “core set verbose
    0″ and then exit the system Fail2Ban will stop working for Asterisk (this
    is since Fail2ban works based on the log file entries).

    Can anyone else please confirm that as well.

    Thanks again for your input.

  • Tzafrir, thanks for the feedback. Can you please elaborate on that. Is that
    something that is not effected by the CLI commands? Not sure which trunk
    you are pointing too.

    Regards,

  • https://reviewboard.asterisk.org/r/1599/
    I so wish that this patch would be backported to the 1.8 branch! I am
    considering switching to trunk just for this alone.

    I know it’s a stretch but, given the popularity of running Fail2Ban
    alongside Asterisk, could it not fall under the pretense of ‘security risk’
    that someone very easily breaks Fail2Ban by forgetting to set verbose back
    to 5 during a routine CLI session where they might have temporarily needed
    to reduce verbosity?

    I know I’m reaching, but doesn’t hurt to beg.

    Luke

  • A definite “me too” from my side. Always wondered why it wasn’t like that.
    It would do wonders to help us fix our own problems instead of filling in
    bugs or posting here 😉 (hint hint)

    Mike

  • Yes that would be a very nice addition. Perhaps someone with Asterisk
    coding skills can backport the patch. Have you checked if it applies at
    all to the latest 1.8 master? I wonder if that patch is already part of
    10 master or the 10.2 branch as I could not see anything mentioned on
    reviewboard.

    Regards,
    Patrick

  • Fair enough.
    Giving up on the backport to 1.8 or 10 for now, I had a thought for a
    kludge.

    How about a shell script (scheduled with cron) that checks for any ‘active’
    consoles — any connected consoles where there has been user input within
    the last X minutes. If it finds none, then set the verbosity back to 5 (or
    whatever level you want).

    There are a few problems with this — I couldn’t find any way to:

    1) query Asterisk for a count or list of console connections, much less
    ‘active’ ones
    2) query Asterisk for the current verbosity level (without changing it)

    Am I barking up another wrong tree here?
    Anyone have any other ideas on how to solve this problem?

  • Wouldn’t a shell script be a band-aid solution?

    CLI verbose should have absolutely no effect on other loggings. I have been
    saying this forever that Asterisk logging should be very strong and
    separate of anything else including what we see on the CLI. This is
    important for security reasons. You forget to put the verbose back to 9
    then your Fail2ban stop working. You are debugging the server and playing
    with “core set verbose” then you are momentarily opening for attacks.

    I do understand what “core set verbose” was initially made for but these
    things are not set in stone and should be improved given security is
    becoming such a huge issue.

    Separating logger.conf from “core set verbose” is the best solution.

    Best,