Can not seperate DHCPD logs for syslog












0















I'm trying to separate DHCPD log from syslog file in Ubuntu 16.4 LTS.



In my dhcpd.conf file I have added:



log-facility local7;


And rsyslog.conf file:



#Logging for DHCP service
local7 /var/log/dhcp/dhcp.log


I have created dhcp folder and dhcp.log files.



Is it permission a issue?










share|improve this question

























  • Did you restart both dhcpd and rsyslogd?

    – PerlDuck
    Feb 3 '18 at 11:50











  • Yes I have restarted rsyslog service and server.

    – Henry
    Feb 4 '18 at 19:26


















0















I'm trying to separate DHCPD log from syslog file in Ubuntu 16.4 LTS.



In my dhcpd.conf file I have added:



log-facility local7;


And rsyslog.conf file:



#Logging for DHCP service
local7 /var/log/dhcp/dhcp.log


I have created dhcp folder and dhcp.log files.



Is it permission a issue?










share|improve this question

























  • Did you restart both dhcpd and rsyslogd?

    – PerlDuck
    Feb 3 '18 at 11:50











  • Yes I have restarted rsyslog service and server.

    – Henry
    Feb 4 '18 at 19:26
















0












0








0








I'm trying to separate DHCPD log from syslog file in Ubuntu 16.4 LTS.



In my dhcpd.conf file I have added:



log-facility local7;


And rsyslog.conf file:



#Logging for DHCP service
local7 /var/log/dhcp/dhcp.log


I have created dhcp folder and dhcp.log files.



Is it permission a issue?










share|improve this question
















I'm trying to separate DHCPD log from syslog file in Ubuntu 16.4 LTS.



In my dhcpd.conf file I have added:



log-facility local7;


And rsyslog.conf file:



#Logging for DHCP service
local7 /var/log/dhcp/dhcp.log


I have created dhcp folder and dhcp.log files.



Is it permission a issue?







dhcp rsyslog






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 4 '18 at 7:17









muru

1




1










asked Feb 3 '18 at 7:36









HenryHenry

1




1













  • Did you restart both dhcpd and rsyslogd?

    – PerlDuck
    Feb 3 '18 at 11:50











  • Yes I have restarted rsyslog service and server.

    – Henry
    Feb 4 '18 at 19:26





















  • Did you restart both dhcpd and rsyslogd?

    – PerlDuck
    Feb 3 '18 at 11:50











  • Yes I have restarted rsyslog service and server.

    – Henry
    Feb 4 '18 at 19:26



















Did you restart both dhcpd and rsyslogd?

– PerlDuck
Feb 3 '18 at 11:50





Did you restart both dhcpd and rsyslogd?

– PerlDuck
Feb 3 '18 at 11:50













Yes I have restarted rsyslog service and server.

– Henry
Feb 4 '18 at 19:26







Yes I have restarted rsyslog service and server.

– Henry
Feb 4 '18 at 19:26












1 Answer
1






active

oldest

votes


















0














add this on top of the rules-Part inrsyslog.confor if present in/etc/rsysconf.d/50-default.conf



but DON'T add local7 /var/log/dhcp/dhcp.log



###############
#### RULES ####
###############

#
# First some standard log files. Log by facility.
#

if $programname == 'dhcpd' then /var/log/dhcp.log
& stop


after that open /etc/logrotate.d/rsyslog and add /var/log/dhcp.log like this



/var/log/syslog
/var/log/dhcp.log
{
rotate 7
daily
missingok
notifempty
delaycompress
compress
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}


if you want to rotete daily



or like this



/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
/var/log/dhcp.log
{
rotate 4
weekly
missingok
notifempty
compress
delaycompress
sharedscripts
postrotate
invoke-rc.d rsyslog rotate > /dev/null
endscript
}


if you want to rotate weekly



Greets Thomas






share|improve this answer

























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "89"
    };
    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: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    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%2faskubuntu.com%2fquestions%2f1002597%2fcan-not-seperate-dhcpd-logs-for-syslog%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









    0














    add this on top of the rules-Part inrsyslog.confor if present in/etc/rsysconf.d/50-default.conf



    but DON'T add local7 /var/log/dhcp/dhcp.log



    ###############
    #### RULES ####
    ###############

    #
    # First some standard log files. Log by facility.
    #

    if $programname == 'dhcpd' then /var/log/dhcp.log
    & stop


    after that open /etc/logrotate.d/rsyslog and add /var/log/dhcp.log like this



    /var/log/syslog
    /var/log/dhcp.log
    {
    rotate 7
    daily
    missingok
    notifempty
    delaycompress
    compress
    postrotate
    invoke-rc.d rsyslog rotate > /dev/null
    endscript
    }


    if you want to rotete daily



    or like this



    /var/log/kern.log
    /var/log/auth.log
    /var/log/user.log
    /var/log/lpr.log
    /var/log/cron.log
    /var/log/debug
    /var/log/messages
    /var/log/dhcp.log
    {
    rotate 4
    weekly
    missingok
    notifempty
    compress
    delaycompress
    sharedscripts
    postrotate
    invoke-rc.d rsyslog rotate > /dev/null
    endscript
    }


    if you want to rotate weekly



    Greets Thomas






    share|improve this answer






























      0














      add this on top of the rules-Part inrsyslog.confor if present in/etc/rsysconf.d/50-default.conf



      but DON'T add local7 /var/log/dhcp/dhcp.log



      ###############
      #### RULES ####
      ###############

      #
      # First some standard log files. Log by facility.
      #

      if $programname == 'dhcpd' then /var/log/dhcp.log
      & stop


      after that open /etc/logrotate.d/rsyslog and add /var/log/dhcp.log like this



      /var/log/syslog
      /var/log/dhcp.log
      {
      rotate 7
      daily
      missingok
      notifempty
      delaycompress
      compress
      postrotate
      invoke-rc.d rsyslog rotate > /dev/null
      endscript
      }


      if you want to rotete daily



      or like this



      /var/log/kern.log
      /var/log/auth.log
      /var/log/user.log
      /var/log/lpr.log
      /var/log/cron.log
      /var/log/debug
      /var/log/messages
      /var/log/dhcp.log
      {
      rotate 4
      weekly
      missingok
      notifempty
      compress
      delaycompress
      sharedscripts
      postrotate
      invoke-rc.d rsyslog rotate > /dev/null
      endscript
      }


      if you want to rotate weekly



      Greets Thomas






      share|improve this answer




























        0












        0








        0







        add this on top of the rules-Part inrsyslog.confor if present in/etc/rsysconf.d/50-default.conf



        but DON'T add local7 /var/log/dhcp/dhcp.log



        ###############
        #### RULES ####
        ###############

        #
        # First some standard log files. Log by facility.
        #

        if $programname == 'dhcpd' then /var/log/dhcp.log
        & stop


        after that open /etc/logrotate.d/rsyslog and add /var/log/dhcp.log like this



        /var/log/syslog
        /var/log/dhcp.log
        {
        rotate 7
        daily
        missingok
        notifempty
        delaycompress
        compress
        postrotate
        invoke-rc.d rsyslog rotate > /dev/null
        endscript
        }


        if you want to rotete daily



        or like this



        /var/log/kern.log
        /var/log/auth.log
        /var/log/user.log
        /var/log/lpr.log
        /var/log/cron.log
        /var/log/debug
        /var/log/messages
        /var/log/dhcp.log
        {
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
        invoke-rc.d rsyslog rotate > /dev/null
        endscript
        }


        if you want to rotate weekly



        Greets Thomas






        share|improve this answer















        add this on top of the rules-Part inrsyslog.confor if present in/etc/rsysconf.d/50-default.conf



        but DON'T add local7 /var/log/dhcp/dhcp.log



        ###############
        #### RULES ####
        ###############

        #
        # First some standard log files. Log by facility.
        #

        if $programname == 'dhcpd' then /var/log/dhcp.log
        & stop


        after that open /etc/logrotate.d/rsyslog and add /var/log/dhcp.log like this



        /var/log/syslog
        /var/log/dhcp.log
        {
        rotate 7
        daily
        missingok
        notifempty
        delaycompress
        compress
        postrotate
        invoke-rc.d rsyslog rotate > /dev/null
        endscript
        }


        if you want to rotete daily



        or like this



        /var/log/kern.log
        /var/log/auth.log
        /var/log/user.log
        /var/log/lpr.log
        /var/log/cron.log
        /var/log/debug
        /var/log/messages
        /var/log/dhcp.log
        {
        rotate 4
        weekly
        missingok
        notifempty
        compress
        delaycompress
        sharedscripts
        postrotate
        invoke-rc.d rsyslog rotate > /dev/null
        endscript
        }


        if you want to rotate weekly



        Greets Thomas







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 27 at 21:13









        Jorge Castro

        36.6k106422617




        36.6k106422617










        answered May 16 '18 at 16:07









        ThomasThomas

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Ask Ubuntu!


            • 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%2faskubuntu.com%2fquestions%2f1002597%2fcan-not-seperate-dhcpd-logs-for-syslog%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

            flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

            Mangá

             ⁒  ․,‪⁊‑⁙ ⁖, ⁇‒※‌, †,⁖‗‌⁝    ‾‸⁘,‖⁔⁣,⁂‾
”‑,‥–,‬ ,⁀‹⁋‴⁑ ‒ ,‴⁋”‼ ⁨,‷⁔„ ‰′,‐‚ ‥‡‎“‷⁃⁨⁅⁣,⁔
⁇‘⁔⁡⁏⁌⁡‿‶‏⁨ ⁣⁕⁖⁨⁩⁥‽⁀  ‴‬⁜‟ ⁃‣‧⁕‮ …‍⁨‴ ⁩,⁚⁖‫ ,‵ ⁀,‮⁝‣‣ ⁑  ⁂– ․, ‾‽ ‏⁁“⁗‸ ‾… ‹‡⁌⁎‸‘ ‡⁏⁌‪ ‵⁛ ‎⁨ ―⁦⁤⁄⁕