No log files

I have installed Asterisk 1.8* and Free PBX 2.9 using this guide
http://www.powerpbx.org/content/rhel-asterisk-freepbx-install-guide-rhel-v6-asterisk-v18-freepbx-v29 on an Open VZ VPS.
All went fine.

But since I udated (via the GUI) to Free PBX 2.10 it won’t write any log files. /var/log/asterisk/full is empty and it also does not log any calls on CDR. If I look at the reports from GUI it always says no calls were found.

Log is owned by asterisk and permission set to CMOD 660.

Despite of that the server works fine, I can make and receive calls and there are also no issues with the GUI, which I can access without problems.

What I find strange is that when I am logged in via SSH console and do a call or an amportal restart, I see the asterisk messages in the console windows.

Does anyone have a clue what I am doing wrong and at which files I need to look to fix this?

what you see logged by default while in the asterisk cli is set in your /etc/asterisk/asterisk.conf file under options

[options]
debug=9
verbose=9

also the nuber of d’s anc v’s if calling from bash

what is logged is set in the /etc/aster/logger*.conf files

typically you will find

full => dtmf,notice,warning,error,debug,verbose

which will write to /var/log/asterisk/full

adding for example aline :-

security => notice,security

would write another file called /var/log/asterisk/security

/etc/asterisk/cdr_mysql.conf describes the connection to your mysql server it must of course agree with a user and password on the server that has access to asteriskcdrdb.

From within the asterisk CLI

module show like cdr_

should show cdr_mysql.so for the call reporting to work,

if not there then you can try to load it with

module load cdr_mysql

Thank you very much. That was truly helpful, at least a point to start with!

I don’t have an /etc/aster folder, but my etc/asterisk folder contains the following conf files:

=============================

etc/asterisk/logger

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;
; This file is part of FreePBX.
;
; FreePBX is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.
;
; FreePBX is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with FreePBX. If not, see http://www.gnu.org/licenses/.
;
; Copyright (C) 2007 Astrogen LLC (USA)

[general]
#include logger_general_additional.conf
#include logger_general_custom.conf

[logfiles]
#include logger_logfiles_additional.conf
#include logger_logfiles_custom.conf

I believe removing the # will make it include the others, right? And which one would I cause asterisk to include?

=============================

The others say:

=============================

include logger_general_additional.conf

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

dateformat=%F %T

=============================

include logger_general_custom.conf

;
; Customize the display of debug message time stamps
; this example is the ISO 8601 date format (yyyy-mm-dd HH:MM:SS)
;
; see strftime(3) Linux manual for format specifiers. Note that there is also
; a fractional second parameter which may be used in this field. Use %1q
; for tenths, %2q for hundredths, etc.
;
;dateformat=%F %T ; ISO 8601 date format
;dateformat=%F %T.%3q ; with milliseconds
;
; This appends the hostname to the name of the log files.
;appendhostname = yes
;
; This determines whether or not we log queue events to a file
; (defaults to yes).
;queue_log = no
;
; Determines whether the queue_log always goes to a file, even
; when a realtime backend is present (defaults to no).
;queue_log_to_file = yes
;
; Set the queue_log filename
; (defaults to queue_log)
;queue_log_name = queue_log
;
; Log rotation strategy:
; sequential: Rename archived logs in order, such that the newest
; has the highest sequence number [default]. When
; exec_after_rotate is set, ${filename} will specify
; the new archived logfile.
; rotate: Rotate all the old files, such that the oldest has the
; highest sequence number [this is the expected behavior
; for Unix administrators]. When exec_after_rotate is
; set, ${filename} will specify the original root filename.
; timestamp: Rename the logfiles using a timestamp instead of a
; sequence number when “logger rotate” is executed.
; When exec_after_rotate is set, ${filename} will
; specify the new archived logfile.
;rotatestrategy = rotate
;
; Run a system command after rotating the files. This is mainly
; useful for rotatestrategy=rotate. The example allows the last
; two archive files to remain uncompressed, but after that point,
; they are compressed on disk.
;
; exec_after_rotate=gzip -9 ${filename}.2
;
;
; For each file, specify what to log.
;
; For console logging, you set options at start of
; Asterisk with -v for verbose and -d for debug
; See ‘asterisk -h’ for more information.
;
; Directory for log files is configures in asterisk.conf
; option astlogdi

=============================

include logger_logfiles_additional.conf is empty

;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: http://freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

=============================

include logger_logfiles_custom.conf has this content:

;
; Format is “filename” and then “levels” of debugging to be included:
; debug
; notice
; warning
; error
; verbose
; dtmf
; fax
;
; Special filename “console” represents the system console
;
; Filenames can either be relative to the standard Asterisk log directory
; (see ‘astlogdir’ in asterisk.conf), or absolute paths that begin with
; ‘/’.
;
; Special level name “" means all levels, even dynamic levels registered
; by modules after the logger has been initialized (this means that loading
; and unloading modules that create/remove dynamic logger levels will result
; in these levels being included on filenames that have a level name of "
”,
; without any need to perform a ‘logger reload’ or similar operation). Note
; that there is no value in specifying both “" and specific level names for
; a filename; the "
” level means all levels, and the remaining level names
; will be ignored.
;
; We highly recommend that you DO NOT turn on debug mode if you are simply
; running a production system. Debug mode turns on a LOT of extra messages,
; most of which you are unlikely to understand without an understanding of
; the underlying code. Do NOT report debug messages as code issues, unless
; you have a specific issue that you are attempting to debug. They are
; messages for just that – debugging – and do not rise to the level of
; something that merit your attention as an Asterisk administrator. Debug
; messages are also very verbose and can and do fill up logfiles quickly;
; this is another reason not to have debug mode on a production system unless
; you are in the process of debugging a specific issue.
;
;debug => debug
console => notice,warning,error
;console => notice,warning,error,debug
messages => notice,warning,error
;full => notice,warning,error,debug,verbose,dtmf,fax

;syslog keyword : This special keyword logs to syslog facility
;
;syslog.local0 => notice,warning,error
;

Could it be that the ; in front of full causes that asterisk won’t write to full?

=============================

/var/log/asterisk/message has usual entries I know from trixbox, e.g.

[2013-08-04 03:43:47] WARNING[1923] pbx.c: Context ‘from-pstn’ tries to include nonexistent context ‘from-pstn-custom’

[2013-08-04 06:04:21] NOTICE[2035] chan_sip.c: Peer ‘6432’ is now Reachable. (180ms / 2000ms)

=============================

CLI module show like cdr_ returns

Module Description Use Count
cdr_syslog.so Customizable syslog CDR Backend 0
cdr_csv.so Comma Separated Values CDR Backend 0
cdr_custom.so Customizable Comma Separated Values CDR 0
cdr_manager.so Asterisk Manager Interface CDR Backend 0
4 modules loaded

But still no call logs. Database settings are correct.

no, the # means to include because asterisk often uses # , ; is chosen as the comment delimiter, which you will notice that it comments out your full log file…

no call logs because cdr_mysql is not loading.

logger_logfiles_custom.conf by removing the # in logger.conf. Difference I spotted is that it now includes security events in the console logging. I still writes warnings and notices into /var/log/asterisk/messages.

Also removed the , before

;full => notice,warning,error,debug,verbose,dtmf,fax
in logger_logfiles_custom.conf, but it still won’t write anything to /var/log/asterisk/full.

last post crossed with yours. I remove the # from logger again

adding the # to logger again resulted in asterisk writing to full, but when type in module load cdr_mysql in CLI it simply does nothing.

then now you have your full log, you will be able to see why it won’t load

I re-added the # in front of the file names in logger…

In logs full I can now read

[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database user found, using ‘asterisk’ as default.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database password found, using ‘asterisk’ as default.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database host found, using localhost via socket.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database name found, using ‘asterisk’ as default.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database port found, using 3306 as default.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database socket found, using ‘/var/lib/mysql/mysql.sock’ as default.
[2013-08-04 12:31:25] WARNING[3231] res_config_mysql.c: MySQL RealTime: No database socket found (and unable to detect a suitable path).

[2013-08-04 12:31:23] NOTICE[3231] cdr.c: CDR simple logging enabled.

The mysql realtime is not useful in FreePBX, you shoud probably not load it. Same goes for cdr_syslog.so , you just need cdr_mysql to load which it won’t if it can’t connect to your mysql database server which is probably 127.0.0.1 (localhost)