Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-309

Logging Developer Guidelines

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.9.3
    • Docs
    • None

    Description

      This should cover:

      • How best to set up logging in your code and related coding style things.

      Examples of things to cover:

      • Use the SLF4J API.
      • Name the Logger instance LOG.
      • Make the Logger instance private static final.
      • Do not construct strings manually, instead use {} and pass args to keep it fast.
      • You do not need to call isDebugEnabled and so on unless you're passing more than 2 args (and using new Object[]).
      • Make sure that you are using the correct logging category.
      • Do not log to System.out.
      • If you have an exception, pass it to the logger.
      • Do not use the Log4J API or other logging APIs directly unless interacting with an API that requires them. (There's an instance of some code from Hadoop that requires that you pass it a particular logger object.)

      Attachments

        Issue Links

          Activity

            People

              brucem Bruce Mitchener
              brucem Bruce Mitchener
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: