//////////////////// Licensed to Cloudera, Inc. under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Cloudera, Inc. licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. //////////////////// === Logging Logging is implemented using the http://www.slf4j.org/[SLF4J API]. Be sure to read the http://www.slf4j.org/docs.html[SLF4J documentation]. ==== Setting Up Logging Typically each class has its own logger. We declare these as follows: [source,java] ---- private static final Logger LOG = LoggerFactory.getLogger(MyClass.class); ---- Things to note here: * We make all loggers ++private static final++ (and in that order). * We name all of our loggers ++LOG++. * We just pass the class, we don't call ++.getName()++ on the class. ==== Logging Exceptions We are using the 1.6 version of SLF4J, so we get to take advantage of the http://www.slf4j.org/faq.html#paramException[improved support] for logging exceptions. ==== Logging Formatting and Performance Notes For a good discussion of this, see the http://www.slf4j.org/faq.html#logging_performance[relevant section] in the SLF4J FAQ.