log personal message to /var/log/messages

August 14th, 2006 mysurface Posted in Admin, backquote, logger, tail | Hits: 86034 | 14 Comments »

To log personal messages to /var/log/messages when you write script, you can use logger

simple example:

logger i am testing

And check the result with tail, it display last 10 line of messages by default

tail /var/log/messages

To put more info to log file, you can specified the timestamp with scriptname by this

logger -t `basename $0` i am still testing

basename is to display scriptname without ./ or the parent’s path, back quote (`) is to pass the result string to logger.

14 Responses to “log personal message to /var/log/messages”

  1. Thanks, very useful!!!

  2. I have a doubt.How do I write a a message from my program to /var/log/messages ? Is this possible? How?

  3. devendra koli Says:

    Thank you so much

  4. DuevEbeverlee Says:

    get and get big save for more detail

  5. My family members always say that I am killing my time here at net, however I know I am getting knowledge everyday by reading such
    nice content.

  6. Hmm it appears like your blog ate my first comment
    (it was super long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog.
    I as well am an aspiring blog blogger but I’m still new to everything. Do you have any tips and hints for inexperienced blog writers? I’d genuinely appreciate it.

  7. This is a topic that’s near to my heart… Thank you!

    Exactly where are your contact details though?

  8. I usually do not write a comment, but I browsed a ton of remarks here log personal message to /var/log/messages ?
    Linux by Examples. I actually do have a couple of questions for you
    if you tend not to mind. Is it only me or do some of the remarks appear as if they are coming from brain dead folks?
    :-P And, if you are posting at additional sites, I would like to follow everything new you
    have to post. Could you make a list of every one of all your social networking sites
    like your twitter feed, Facebook page or linkedin profile?

    Feel free to visit my webpage :: The Baby Télécharger Le Film

  9. I’m impressed, I must say. Rarely do I encounter a blog that’s both equally educative
    and interesting, and let me tell you, you’ve hit the nail on the head.

    The issue is something too few men and women are speaking
    intelligently about. I am very happy I came
    across this in my hunt for something concerning this.

    my blog post: Match Retour Télécharger Le Film

  10. My brother suggested I would possibly like this web site.
    He used to be entirely right. This put up actually made my day.
    You can not believe just how a lot time I had spent for this info!

    Thanks!

    my weblog Avis de mistral Télécharger Le Film

  11. Right here is the perfect site for everyone who wishes to understand this topic.

    You know so much its almost tough to argue with you (not that I personally would
    want to…HaHa). You definitely put a brand new spin
    on a topic that’s been written about for years.

    Great stuff, just excellent!

    Here is my homepage; Dark Touch Télécharger Le Film

  12. Thanks for one’s marvelous posting! I quite enjoyed reading it, you happen to be a great author.
    I will be sure to bookmark your blog and will come back someday.
    I want to encourage one to continue your great job, have a nice day!

    Here is my blog; la vérité sur l’affaire Ilan Halimi Télécharger Le Film

  13. Hi, yup this article is truly good and I have learned lot of things
    from it concerning blogging. thanks.

    Here is my weblog :: Le Vent se lève Télécharger le film

  14. ??????????????? ???????????????????????????????????????????????

    ???????????????????? ???????????????
    ??????????????? ??10?????????????????????? ?????????????????????????

    ???????wwwwwwwwwwwwwwwwwwwww ?? (is.gd) ???????? ???? ???wwwwwwwwwwwwwwwwwwww

Leave a Reply