logger + how to change the logger title instead user root












0















I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man



for example I send the following warning to the log



[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#


but how to use the logger in order to get whatsapp_man instead of root



as the fowling expected results



[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#









share|improve this question

























  • its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

    – yael
    Mar 4 at 14:31











  • any please wrote answer to the first question and I will vote for you

    – yael
    Mar 4 at 14:31











  • for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

    – Jeff Schaller
    Mar 4 at 14:39
















0















I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man



for example I send the following warning to the log



[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#


but how to use the logger in order to get whatsapp_man instead of root



as the fowling expected results



[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#









share|improve this question

























  • its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

    – yael
    Mar 4 at 14:31











  • any please wrote answer to the first question and I will vote for you

    – yael
    Mar 4 at 14:31











  • for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

    – Jeff Schaller
    Mar 4 at 14:39














0












0








0








I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man



for example I send the following warning to the log



[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#


but how to use the logger in order to get whatsapp_man instead of root



as the fowling expected results



[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#









share|improve this question
















I want to use the log - /var/log/message for my logs
my application name is - whatsapp_man



for example I send the following warning to the log



[root@worker01 ~]# logger "please noitce you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 root: please notice you are before attack
[root@worker01 ~]#


but how to use the logger in order to get whatsapp_man instead of root



as the fowling expected results



[root@worker01 ~]# logger [....] "please notice you are before attack"
[root@worker01 ~]# tail -1 /var/log/messages
Mar 4 13:28:05 worker01 whatsapp_man: please notice you are before attack
[root@worker01 ~]#






linux logs logger






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 4 at 13:53









Jeff Schaller

44k1161142




44k1161142










asked Mar 4 at 13:32









yaelyael

2,78132777




2,78132777













  • its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

    – yael
    Mar 4 at 14:31











  • any please wrote answer to the first question and I will vote for you

    – yael
    Mar 4 at 14:31











  • for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

    – Jeff Schaller
    Mar 4 at 14:39



















  • its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

    – yael
    Mar 4 at 14:31











  • any please wrote answer to the first question and I will vote for you

    – yael
    Mar 4 at 14:31











  • for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

    – Jeff Schaller
    Mar 4 at 14:39

















its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

– yael
Mar 4 at 14:31





its workers , can I ask another question please , let say we want to use the logger on some other log file as /var/log/server.log , is it possible to use loggger to write logs to server.log?

– yael
Mar 4 at 14:31













any please wrote answer to the first question and I will vote for you

– yael
Mar 4 at 14:31





any please wrote answer to the first question and I will vote for you

– yael
Mar 4 at 14:31













for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

– Jeff Schaller
Mar 4 at 14:39





for your commented-question, see unix.stackexchange.com/questions/67708/… and/or unix.stackexchange.com/questions/434459/…

– Jeff Schaller
Mar 4 at 14:39










1 Answer
1






active

oldest

votes


















1














The prefix you're looking for is provided by the -t option of logger:



logger -t whatsapp_man "..."





share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504270%2flogger-how-to-change-the-logger-title-instead-user-root%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    The prefix you're looking for is provided by the -t option of logger:



    logger -t whatsapp_man "..."





    share|improve this answer




























      1














      The prefix you're looking for is provided by the -t option of logger:



      logger -t whatsapp_man "..."





      share|improve this answer


























        1












        1








        1







        The prefix you're looking for is provided by the -t option of logger:



        logger -t whatsapp_man "..."





        share|improve this answer













        The prefix you're looking for is provided by the -t option of logger:



        logger -t whatsapp_man "..."






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 4 at 14:38









        Jeff SchallerJeff Schaller

        44k1161142




        44k1161142






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f504270%2flogger-how-to-change-the-logger-title-instead-user-root%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to make a Squid Proxy server?

            第一次世界大戦

            Touch on Surface Book