Log Collection Instructions

I remember, from a long time ago, there used to be a sticky or wiki entry on Asterisk Log Collection Instructions. I’ve searched without success until I started writing this post and discovered “Chapter 24.”

I learned a lot from Chapter 24. System Monitoring and Logging: logger.conf
URL: logger.conf

Console Logging:

Note: Setting an integer level via the console will set the level globally affecting any matching, enabled, logging specified in logger.conf

  1. Turn on PJSIP logging
    Console Command:
    CLI> pjsip set logger on
  2. Set verbose
    Console Command:
    CLI> core set verbose 5
    Alternately set from CL at startup:
    #] asterisk -cvvvvv
  3. Turn on DEBUG and set level
    Console Command:
    CLI> core set debug 5

Logging to log files configured via logger.conf:

ref: Chapter 24. System Monitoring and Logging: logger.conf
URL: logger.conf

Finally, you must edit /etc/asterisk/logger.conf:
Default should appear as:
messages => notice,warning,error

Append “debug,verbose”
messages => notice,warning,error,debug,verbose

Important Note, you can specify [integer] levels here or via the console, using the above “Append” as an example:
messages => notice,warning,error,debug 5,verbose 5

Important Note: You can also specify level in the console which sets the level globally meaning console level and level for matching setting in logger.conf

Issue the following command to reload logger settings:
CLI> logger reload

Given the amount of time and effort searching and that I came across Chapter 24 only in preparing this article I’m hoping this article helps others more-easily find this information.

Just a tip, if you are fed up of typing all those “v” characters, edit your asterisk.conf and change the verbose setting to, e.g.

verbose = 100

Now you don’t have to type any “v” characters at all.

1 Like

You can also setup default debugging in pjsip.conf like this:

1 Like

@ldo @cable

Thenk you very much for the awesome tips!!!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.