Asterisk 1.4.22 full log file

Discussion in 'General' started by MST, Jan 22, 2010.

  1. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Hello all,

    I have noticed that full log file is getting bigger every day. If am not wrong that file would be made every day
    like full.1 full.2 full.3 etc....

    Where can I change it or take a look what causes that behaviour?

    Thank You for any advice.
     
  2. Amphibian

    Joined:
    Sep 8, 2009
    Messages:
    1,128
    Likes Received:
    2
    Look into reading "Elastix Without Tears" under "Documentation", you will see under section 45 of that reading that log files are your friends. You can use the builtin editor "Vi" to open these log files and see what they are about. Search the internet for how to use Vi from the command line.

    Another good source would be to obtain a book on Linux (such as Red Hat Linux Bible or one like it) and read up on the basics of Linux and log files.

    Hope that helps, in addition you could probably do a search on this site for log files and obtain additional common answers.
     
  3. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    By default the logs will rotate, try (from bash, the default shell)

    rasterisk -x "logger rotate"

    to rotate the logs manually,

    man logger

    to understand the logger process


    tail -f /var/log/asterisk/full

    for a realtime trace of the curret log.

    less /var/log/asterisk/full

    to browse the current log file (probably after the logger rotate if you have a runaway process.)

    grep <expression> /var/log/asterisk/full*

    to filter the all the log rotations by expression

    man grep

    to use a filter more complicated than a case sensitive string.
     
  4. saleh

    Joined:
    Apr 18, 2007
    Messages:
    249
    Likes Received:
    0
    To reduced the asterisk log

    vi /etc/asterisk/logger.conf
    and change this line full => notice,warning,error,debug,verbose
    to
    full => notice,warning,error,verbose
    or
    full => notice,warning,error

    then
    CLI> reload logger

    Best Regards,

    Saleh
     
  5. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Thank You all for a quick reply. Again, the problem is I have only 1 file full about 65MB and every day it is getting bigger. If I want to open it I have to wait pretty long.

    I know this file "full" in /var/log/asterisk can be devided by full.1,full.2, full.3, etc. so every day I can get 1 full file from each day. I am trying to figure it out how to chnage that to have full log from every day not like now only one file full.
    Normally this file is rotated but in my case looks like not and I get only 1 "full" log file.

    MST
     
  6. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    65M isn't so big, just don't open it read/write, there is little point in writing to it, just use less, cat, tail or grep, from bash, all pretty well instantaneous.

    I reiterate
    .
    .
    rasterisk -x "logger rotate"

    to rotate the logs manually,

    man logger

    to understand the logger process
    .
    .

    I will add

    man logrotate

    to your homework and encourage you to explore the contents of /etc/logrotate.d/ and discover why:

    asterisk-add.logrotate

    is not working for you.
     
  7. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Dicko,

    Thank you for reply. I have fallowed your instructions and I see now full.0 = 64M
    full.1 = 169k and full = 3k
    I have 2 logrotate files in /etc/logrotate.d/asterisk
    Code:
    /var/log/asterisk/messages /var/log/asterisk/*log /var/log/asterisk/debug /var/log/asterisk/console /var/log/asterisk/full {
        create 0640 asterisk asterisk
        daily
        extension .txt
        mail root@localhost
        missingok
        nocompress
    #    notifempty
        rotate 32
        sharedscripts
    #    size 10M
        postrotate
    	/usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>/dev/null || true
        endscript
    }
    
    /var/log/asterisk/cdr-csv/*csv /var/log/asterisk/cdr-custom/*csv {
        create 0640 asterisk asterisk
        monthly
        extension .txt
        mail root@localhost
        missingok
        nocompress
    #    notifempty
        rotate 2
        sharedscripts
    #    size 10M
        postrotate
    	/usr/sbin/asterisk -rx 'logger reload' >/dev/null 2>/dev/null || true
        endscript
    }
    
    and asterisk.logrotate
    Code:
    /var/log/asterisk/*log {
       missingok
       rotate 5
       weekly
       create 0640 asterisk asterisk
       postrotate
           /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
       endscript
    }
    
    /var/log/asterisk/full {
       missingok
       rotate 5
       daily
       create 0640 asterisk asterisk
       postrotate
           /usr/sbin/asterisk -rx 'logger reload' > /dev/null 2> /dev/null
       endscript
    }
    
    /var/log/asterisk/cdr-csv/*csv {
      missingok
      rotate 5
      monthly
      create 0640 asterisk asterisk
    }
     
    /var/log/atftp.log {
      missingok
      rotate 5
      monthly
      create 0640 nobody nobody
    } 
    
    My suspicious is against "rotate 32" and "# size 10M" and looks like the last one took out 10M limitation so is that why there is one file?

    Thank You for your help. MST
     
  8. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    You do seem to have a bit of mess, I assume this is not a native Elastix install.

    would remove /etc/logrotate.d/asterisk as it seems to refer to a non Elastix type Install, have you any idea where it came from?
     
  9. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Yes I agree - if it was Elastix it would not be in big mess. It is Trixbox 2.6.2.3 fresh installation. The only one application that was added was MONDO, but I dont think it would do such mess. Becasue I see that logrotate is working and see full.x new files let's treat this thread as resolved.

    Thank You for your help.
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Your welcome,

    but I am intrigued, why would you ask for help with a fresh install of Trixbox in an Elastix forum?
     
  11. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    The true is more and more posts are ignored there, so I have decided to try Elastix forum in this particular example. And so far I am not disappointed.
    If you are lucky you can get answer there, but if not ..... I understand that a lot of posts just are duplicating that means that people don't try to search first, they just ask without any effort. There are two sides of that problem. Regarding this particular example, (Elastix and Trixbox) are interconnect together so looking for help everywhere is the last chance to get it working properly.

    Best Regards, MST
     
  12. rafael

    Joined:
    May 14, 2007
    Messages:
    1,454
    Likes Received:
    1
    Dicko, So the first advice should be install Elastix instead of Trixbox ;).

    MST, if you are using Trixbox the best thing would be to ask the question in the Trixbox forum. If you use Elastix we would be more than happy to help you. What ever your choice is, we would wish you the best luck.

    Best regards,

    Rafael
     
  13. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    Raf,

    Indeed had I known, it would have saved us both time ;)

    This is an example of what happens when others "fork things up",
     
  14. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    I am all the time thinking about switching all my clients OS to Elastix but it is more complex that I thought especially when most of them are located remotely.

    I like Elastix 2.0, even thought it is in BETA mode so not stable yet but I will patiently wait for that.

    CHeers,
     
  15. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    You see, I did not write on the begining of this post what OS it was regarding :) I did not write it was Elastix :)

    Dicko figured it out that both files look suspicous like for Elastix and this is true ..... I have kindly answered
    for a question about OS (it wasn't Elastix) However, Dicko gave me some right directoins to the problem that is I think resolved. I appreciate that and I am thankfull for Dicko for the help. I will have more Elastix OS in the future than Triboxes because simply that free product is better today than Trixbox. This is just my 2 cents.

    Cheers,
     
  16. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    .
    .
    .You see, I did not write on the begining of this post what OS it was regarding :) I did not write it was Elastix :)
    .
    .
    My 2 cents worth ( and 20 minutes worth ) is that surely the point of an Elastix support forum is to support Elastix, I imagined we would all make that presumption, had it been an Elastix box you would not have had the problem in the first place, had you been upfront about it being a trixbox machine, I for one would have not been interested in replying.

    So I guess you win, and I loose (at least my time) but once bitten, twice shy. In my opinion your post verged on, if not was, duplicity.

    disdainfully

    dicko
     

Share This Page