Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dhcp
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 107
    • Issues 107
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • ISC Open Source Projects
  • dhcp
  • Issues
  • #17

Closed
Open
Created May 18, 2019 by Joe LeVeque@jlevequeGuest

Log messages always additionally print to console, even in release builds

name:  Log messages always additionally print to console, even in release builds

Describe the bug

Lines 40-44 of omapip/errwarn.c define log_perror differently based on whether or not it is a DEBUG build. This is done in order to print all log messages to stderr in addition to logging them to syslog if compiled with DEBUG defined.

However, the definitions are currently as follows:

#ifdef DEBUG
int log_perror = -1;
#else
int log_perror = 1;
#endif

Therefore, log_perror is always nonzero no matter whether DEBUG is defined or not, thus always causing all log_*() functions to print log messages to stderr in addition to logging them to syslog.

For our application, we are redirecting output from stderr to syslog, and we have a very noisy log because we are seeing all log messages at INFO level and above twice as well as all DEBUG-level messages show up in our syslogs, even though DEBUG-level messages are disabled in release builds.

Please let me know if you have any questions.

To Reproduce

  1. Compile dhcp in non-DEBUG mode (i.e., don't define DEBUG)
  2. Run a DHCP program (e.g., dhcrelay) in non-daemon mode (or run in daemon mode but make sure to have a facility to redirect stderr to somewhere visible, like syslog)
  3. Notice that all log_*() functions are also echoed to stderr, although they should not be

Expected behavior

If compiled without defining DEBUG, log messages should not also get output to stderr

Environment:

  • ISC DHCP version: All releases (it appears this bug has existed since 1/26/2000)
  • OS: All

Additional Information

I originally submitted this bug via your old bug reporting system as "ISC-Bugs #47288" on 3/8/2018. It appears that system was deprecated soon thereafter?

Describe the solution you'd like

A quick and simple fix is below:

#ifdef DEBUG
int log_perror = 1;
#else
int log_perror = 0;
#endif
Edited May 22, 2019 by Joe LeVeque
Assignee
Assign to
Time tracking