Apache log4cxx  Version 0.11.0
logger.h
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _LOG4CXX_LOGGER_H
19 #define _LOG4CXX_LOGGER_H
20 
21 #if defined(_MSC_VER) && (_MSC_VER < 1900)
22  #pragma warning ( push )
23  #pragma warning ( disable: 4127 )
24 #endif
25 #if defined(_MSC_VER)
26  #pragma warning ( push )
27  #pragma warning ( disable: 4231 4251 4275 4786 )
28 #endif
29 
30 #include <log4cxx/helpers/appenderattachableimpl.h>
31 #include <log4cxx/level.h>
32 #include <log4cxx/helpers/pool.h>
33 #include <log4cxx/helpers/mutex.h>
34 #include <log4cxx/spi/location/locationinfo.h>
35 #include <log4cxx/helpers/resourcebundle.h>
36 #include <log4cxx/helpers/messagebuffer.h>
37 
38 
39 namespace log4cxx
40 {
41 
42 namespace helpers
43 {
44 class synchronized;
45 }
46 
47 namespace spi
48 {
49 class LoggerRepository;
50 LOG4CXX_PTR_DEF(LoggerRepository);
51 class LoggerFactory;
52 LOG4CXX_PTR_DEF(LoggerFactory);
53 }
54 
55 class Logger;
57 LOG4CXX_PTR_DEF(Logger);
58 LOG4CXX_LIST_DEF(LoggerList, LoggerPtr);
59 
60 
65 class LOG4CXX_EXPORT Logger :
66  public virtual log4cxx::spi::AppenderAttachable,
67  public virtual helpers::ObjectImpl
68 {
69  public:
70  DECLARE_ABSTRACT_LOG4CXX_OBJECT(Logger)
71  BEGIN_LOG4CXX_CAST_MAP()
72  LOG4CXX_CAST_ENTRY(Logger)
73  LOG4CXX_CAST_ENTRY(spi::AppenderAttachable)
74  END_LOG4CXX_CAST_MAP()
75 
76  private:
80  helpers::Pool* pool;
81 
82  protected:
86  LogString name;
87 
93 
98 
103  helpers::ResourceBundlePtr resourceBundle;
104 
105 
106  // Loggers need to know what Hierarchy they are in
107  log4cxx::spi::LoggerRepository* repository;
108 
109  helpers::AppenderAttachableImplPtr aai;
110 
118  bool additive;
119 
120  protected:
121  friend class DefaultLoggerFactory;
122 
133  Logger(log4cxx::helpers::Pool& pool, const LogString& name);
134 
135  public:
136  ~Logger();
137 
138 
139  void addRef() const;
140  void releaseRef() const;
141 
149  virtual void addAppender(const AppenderPtr& newAppender);
150 
151 
164  void callAppenders(const log4cxx::spi::LoggingEventPtr& event, log4cxx::helpers::Pool& p) const;
165 
170  void closeNestedAppenders();
171 
185  void debug(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
198  void debug(const std::string& msg) const;
199 #if LOG4CXX_WCHAR_T_API
200 
213  void debug(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
226  void debug(const std::wstring& msg) const;
227 #endif
228 #if LOG4CXX_UNICHAR_API
229 
242  void debug(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
255  void debug(const std::basic_string<UniChar>& msg) const;
256 #endif
257 #if LOG4CXX_CFSTRING_API
258 
271  void debug(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
284  void debug(const CFStringRef& msg) const;
285 #endif
286 
300  void error(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
313  void error(const std::string& msg) const;
314 #if LOG4CXX_WCHAR_T_API
315 
327  void error(const std::wstring& msg) const;
341  void error(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
342 #endif
343 #if LOG4CXX_UNICHAR_API
344 
357  void error(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
370  void error(const std::basic_string<UniChar>& msg) const;
371 #endif
372 #if LOG4CXX_CFSTRING_API
373 
386  void error(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
399  void error(const CFStringRef& msg) const;
400 #endif
401 
415  void fatal(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
428  void fatal(const std::string& msg) const;
429 #if LOG4CXX_WCHAR_T_API
430 
443  void fatal(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
456  void fatal(const std::wstring& msg) const;
457 #endif
458 #if LOG4CXX_UNICHAR_API
459 
472  void fatal(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
485  void fatal(const std::basic_string<UniChar>& msg) const;
486 #endif
487 #if LOG4CXX_CFSTRING_API
488 
501  void fatal(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
514  void fatal(const CFStringRef& msg) const;
515 #endif
516 
524  void forcedLog(const LevelPtr& level, const std::string& message,
525  const log4cxx::spi::LocationInfo& location) const;
532  void forcedLog(const LevelPtr& level, const std::string& message) const;
533 
534 #if LOG4CXX_WCHAR_T_API
535 
542  void forcedLog(const LevelPtr& level, const std::wstring& message,
543  const log4cxx::spi::LocationInfo& location) const;
550  void forcedLog(const LevelPtr& level, const std::wstring& message) const;
551 #endif
552 #if LOG4CXX_UNICHAR_API || LOG4CXX_CFSTRING_API
553 
560  void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message,
561  const log4cxx::spi::LocationInfo& location) const;
568  void forcedLog(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
569 #endif
570 #if LOG4CXX_CFSTRING_API
571 
578  void forcedLog(const LevelPtr& level, const CFStringRef& message,
579  const log4cxx::spi::LocationInfo& location) const;
586  void forcedLog(const LevelPtr& level, const CFStringRef& message) const;
587 #endif
588 
595  void forcedLogLS(const LevelPtr& level, const LogString& message,
596  const log4cxx::spi::LocationInfo& location) const;
597 
601  bool getAdditivity() const;
602 
608  AppenderList getAllAppenders() const;
609 
614  AppenderPtr getAppender(const LogString& name) const;
615 
625  virtual const LevelPtr& getEffectiveLevel() const;
626 
631  log4cxx::spi::LoggerRepositoryPtr getLoggerRepository() const;
632 
633 
638  const LogString& getName() const
639  {
640  return name;
641  }
646  void getName(std::string& name) const;
647 #if LOG4CXX_WCHAR_T_API
648 
652  void getName(std::wstring& name) const;
653 #endif
654 #if LOG4CXX_UNICHAR_API
655 
659  void getName(std::basic_string<UniChar>& name) const;
660 #endif
661 #if LOG4CXX_CFSTRING_API
662 
666  void getName(CFStringRef& name) const;
667 #endif
668 
675  LoggerPtr getParent() const;
676 
677 
683  LevelPtr getLevel() const;
684 
689  static LoggerPtr getLogger(const std::string& name);
694  static LoggerPtr getLogger(const char* const name);
695 #if LOG4CXX_WCHAR_T_API
696 
700  static LoggerPtr getLogger(const std::wstring& name);
705  static LoggerPtr getLogger(const wchar_t* const name);
706 #endif
707 #if LOG4CXX_UNICHAR_API
708 
712  static LoggerPtr getLogger(const std::basic_string<UniChar>& name);
713 #endif
714 #if LOG4CXX_CFSTRING_API
715 
719  static LoggerPtr getLogger(const CFStringRef& name);
720 #endif
721 
725  static LoggerPtr getLoggerLS(const LogString& name);
726 
730  static LoggerPtr getRootLogger();
731 
745  static LoggerPtr getLoggerLS(const LogString& name,
746  const log4cxx::spi::LoggerFactoryPtr& factory);
760  static LoggerPtr getLogger(const std::string& name,
761  const log4cxx::spi::LoggerFactoryPtr& factory);
762 #if LOG4CXX_WCHAR_T_API
763 
776  static LoggerPtr getLogger(const std::wstring& name,
777  const log4cxx::spi::LoggerFactoryPtr& factory);
778 #endif
779 #if LOG4CXX_UNICHAR_API
780 
793  static LoggerPtr getLogger(const std::basic_string<UniChar>& name,
794  const log4cxx::spi::LoggerFactoryPtr& factory);
795 #endif
796 #if LOG4CXX_CFSTRING_API
797 
810  static LoggerPtr getLogger(const CFStringRef& name,
811  const log4cxx::spi::LoggerFactoryPtr& factory);
812 #endif
813 
823  helpers::ResourceBundlePtr getResourceBundle() const;
824 
825  protected:
835  LogString getResourceBundleString(const LogString& key) const;
836 
837  public:
851  void info(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
852  void info(const std::string& msg) const;
853 #if LOG4CXX_WCHAR_T_API
854 
867  void info(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
880  void info(const std::wstring& msg) const;
881 #endif
882 #if LOG4CXX_UNICHAR_API
883 
896  void info(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
909  void info(const std::basic_string<UniChar>& msg) const;
910 #endif
911 #if LOG4CXX_CFSTRING_API
912 
925  void info(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
938  void info(const CFStringRef& msg) const;
939 #endif
940 
944  bool isAttached(const AppenderPtr& appender) const;
945 
980  bool isDebugEnabled() const;
981 
990  bool isEnabledFor(const LevelPtr& level) const;
991 
992 
1000  bool isInfoEnabled() const;
1001 
1009  bool isWarnEnabled() const;
1010 
1018  bool isErrorEnabled() const;
1019 
1027  bool isFatalEnabled() const;
1028 
1036  bool isTraceEnabled() const;
1037 
1054  void l7dlog(const LevelPtr& level, const LogString& key,
1055  const log4cxx::spi::LocationInfo& locationInfo,
1056  const std::vector<LogString>& values) const;
1071  void l7dlog(const LevelPtr& level, const std::string& key,
1072  const log4cxx::spi::LocationInfo& locationInfo) const;
1088  void l7dlog(const LevelPtr& level, const std::string& key,
1089  const log4cxx::spi::LocationInfo& locationInfo,
1090  const std::string& val1) const;
1107  void l7dlog(const LevelPtr& level, const std::string& key,
1108  const log4cxx::spi::LocationInfo& locationInfo,
1109  const std::string& val1, const std::string& val2) const;
1127  void l7dlog(const LevelPtr& level, const std::string& key,
1128  const log4cxx::spi::LocationInfo& locationInfo,
1129  const std::string& val1, const std::string& val2, const std::string& val3) const;
1130 
1131 #if LOG4CXX_WCHAR_T_API
1132 
1146  void l7dlog(const LevelPtr& level, const std::wstring& key,
1147  const log4cxx::spi::LocationInfo& locationInfo) const;
1163  void l7dlog(const LevelPtr& level, const std::wstring& key,
1164  const log4cxx::spi::LocationInfo& locationInfo,
1165  const std::wstring& val1) const;
1182  void l7dlog(const LevelPtr& level, const std::wstring& key,
1183  const log4cxx::spi::LocationInfo& locationInfo,
1184  const std::wstring& val1, const std::wstring& val2) const;
1202  void l7dlog(const LevelPtr& level, const std::wstring& key,
1203  const log4cxx::spi::LocationInfo& locationInfo,
1204  const std::wstring& val1, const std::wstring& val2, const std::wstring& val3) const;
1205 #endif
1206 #if LOG4CXX_UNICHAR_API
1207 
1221  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1222  const log4cxx::spi::LocationInfo& locationInfo) const;
1238  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1239  const log4cxx::spi::LocationInfo& locationInfo,
1240  const std::basic_string<UniChar>& val1) const;
1257  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1258  const log4cxx::spi::LocationInfo& locationInfo,
1259  const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2) const;
1277  void l7dlog(const LevelPtr& level, const std::basic_string<UniChar>& key,
1278  const log4cxx::spi::LocationInfo& locationInfo,
1279  const std::basic_string<UniChar>& val1, const std::basic_string<UniChar>& val2,
1280  const std::basic_string<UniChar>& val3) const;
1281 #endif
1282 #if LOG4CXX_CFSTRING_API
1283 
1297  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1298  const log4cxx::spi::LocationInfo& locationInfo) const;
1314  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1315  const log4cxx::spi::LocationInfo& locationInfo,
1316  const CFStringRef& val1) const;
1333  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1334  const log4cxx::spi::LocationInfo& locationInfo,
1335  const CFStringRef& val1, const CFStringRef& val2) const;
1353  void l7dlog(const LevelPtr& level, const CFStringRef& key,
1354  const log4cxx::spi::LocationInfo& locationInfo,
1355  const CFStringRef& val1, const CFStringRef& val2,
1356  const CFStringRef& val3) const;
1357 #endif
1358 
1366  void log(const LevelPtr& level, const std::string& message,
1367  const log4cxx::spi::LocationInfo& location) const;
1375  void log(const LevelPtr& level, const std::string& message) const;
1376 #if LOG4CXX_WCHAR_T_API
1377 
1384  void log(const LevelPtr& level, const std::wstring& message,
1385  const log4cxx::spi::LocationInfo& location) const;
1393  void log(const LevelPtr& level, const std::wstring& message) const;
1394 #endif
1395 #if LOG4CXX_UNICHAR_API
1396 
1403  void log(const LevelPtr& level, const std::basic_string<UniChar>& message,
1404  const log4cxx::spi::LocationInfo& location) const;
1412  void log(const LevelPtr& level, const std::basic_string<UniChar>& message) const;
1413 #endif
1414 #if LOG4CXX_CFSTRING_API
1415 
1422  void log(const LevelPtr& level, const CFStringRef& message,
1423  const log4cxx::spi::LocationInfo& location) const;
1431  void log(const LevelPtr& level, const CFStringRef& message) const;
1432 #endif
1433 
1440  void logLS(const LevelPtr& level, const LogString& message,
1441  const log4cxx::spi::LocationInfo& location) const;
1442 
1443 
1444 
1450  void removeAllAppenders();
1451 
1455  void removeAppender(const AppenderPtr& appender);
1456 
1461  void removeAppender(const LogString& name);
1462 
1466  void setAdditivity(bool additive);
1467 
1468  protected:
1469  friend class Hierarchy;
1472  void setHierarchy(spi::LoggerRepository* repository);
1473 
1474  public:
1481  virtual void setLevel(const LevelPtr& level);
1482 
1486  inline void setResourceBundle(const helpers::ResourceBundlePtr& bundle)
1487  {
1488  resourceBundle = bundle;
1489  }
1490 
1491 #if LOG4CXX_WCHAR_T_API
1492 
1505  void warn(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
1518  void warn(const std::wstring& msg) const;
1519 #endif
1520 #if LOG4CXX_UNICHAR_API
1521 
1534  void warn(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
1547  void warn(const std::basic_string<UniChar>& msg) const;
1548 #endif
1549 #if LOG4CXX_CFSTRING_API
1550 
1563  void warn(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
1576  void warn(const CFStringRef& msg) const;
1577 #endif
1578 
1591  void warn(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
1604  void warn(const std::string& msg) const;
1605 
1606 #if LOG4CXX_WCHAR_T_API
1607 
1620  void trace(const std::wstring& msg, const log4cxx::spi::LocationInfo& location) const;
1633  void trace(const std::wstring& msg) const;
1634 #endif
1635 #if LOG4CXX_UNICHAR_API
1636 
1649  void trace(const std::basic_string<UniChar>& msg, const log4cxx::spi::LocationInfo& location) const;
1662  void trace(const std::basic_string<UniChar>& msg) const;
1663 #endif
1664 #if LOG4CXX_CFSTRING_API
1665 
1678  void trace(const CFStringRef& msg, const log4cxx::spi::LocationInfo& location) const;
1691  void trace(const CFStringRef& msg) const;
1692 #endif
1693 
1706  void trace(const std::string& msg, const log4cxx::spi::LocationInfo& location) const;
1719  void trace(const std::string& msg) const;
1720 
1721  inline SHARED_MUTEX& getMutex()
1722  {
1723  return mutex;
1724  }
1725 
1726  private:
1727  //
1728  // prevent copy and assignment
1729  Logger(const Logger&);
1730  Logger& operator=(const Logger&);
1731  mutable SHARED_MUTEX mutex;
1732  friend class log4cxx::helpers::synchronized;
1733 };
1734 LOG4CXX_LIST_DEF(LoggerList, LoggerPtr);
1735 
1736 }
1737 
1742 #if !defined(LOG4CXX_UNLIKELY)
1743  #if __GNUC__ >= 3
1744 
1750  #define LOG4CXX_UNLIKELY(expr) __builtin_expect(expr, 0)
1751  #else
1752 
1758  #define LOG4CXX_UNLIKELY(expr) expr
1759  #endif
1760 #endif
1761 
1762 
1770 #define LOG4CXX_LOG(logger, level, message) do { \
1771  if (logger->isEnabledFor(level)) {\
1772  ::log4cxx::helpers::MessageBuffer oss_; \
1773  logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1774 
1782 #define LOG4CXX_LOGLS(logger, level, message) do { \
1783  if (logger->isEnabledFor(level)) {\
1784  ::log4cxx::helpers::LogCharMessageBuffer oss_; \
1785  logger->forcedLog(level, oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1786 
1787 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 10000
1788 
1794 #define LOG4CXX_DEBUG(logger, message) do { \
1795  if (LOG4CXX_UNLIKELY(logger->isDebugEnabled())) {\
1796  ::log4cxx::helpers::MessageBuffer oss_; \
1797  logger->forcedLog(::log4cxx::Level::getDebug(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1798 #else
1799 #define LOG4CXX_DEBUG(logger, message)
1800 #endif
1801 
1802 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 5000
1803 
1809 #define LOG4CXX_TRACE(logger, message) do { \
1810  if (LOG4CXX_UNLIKELY(logger->isTraceEnabled())) {\
1811  ::log4cxx::helpers::MessageBuffer oss_; \
1812  logger->forcedLog(::log4cxx::Level::getTrace(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1813 #else
1814 #define LOG4CXX_TRACE(logger, message)
1815 #endif
1816 
1817 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 20000
1818 
1824 #define LOG4CXX_INFO(logger, message) do { \
1825  if (logger->isInfoEnabled()) {\
1826  ::log4cxx::helpers::MessageBuffer oss_; \
1827  logger->forcedLog(::log4cxx::Level::getInfo(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1828 #else
1829 #define LOG4CXX_INFO(logger, message)
1830 #endif
1831 
1832 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 30000
1833 
1839 #define LOG4CXX_WARN(logger, message) do { \
1840  if (logger->isWarnEnabled()) {\
1841  ::log4cxx::helpers::MessageBuffer oss_; \
1842  logger->forcedLog(::log4cxx::Level::getWarn(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1843 #else
1844 #define LOG4CXX_WARN(logger, message)
1845 #endif
1846 
1847 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 40000
1848 
1854 #define LOG4CXX_ERROR(logger, message) do { \
1855  if (logger->isErrorEnabled()) {\
1856  ::log4cxx::helpers::MessageBuffer oss_; \
1857  logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1858 
1866 #define LOG4CXX_ASSERT(logger, condition, message) do { \
1867  if (!(condition) && logger->isErrorEnabled()) {\
1868  ::log4cxx::helpers::MessageBuffer oss_; \
1869  logger->forcedLog(::log4cxx::Level::getError(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1870 
1871 #else
1872 #define LOG4CXX_ERROR(logger, message)
1873 #define LOG4CXX_ASSERT(logger, condition, message)
1874 #endif
1875 
1876 #if !defined(LOG4CXX_THRESHOLD) || LOG4CXX_THRESHOLD <= 50000
1877 
1883 #define LOG4CXX_FATAL(logger, message) do { \
1884  if (logger->isFatalEnabled()) {\
1885  ::log4cxx::helpers::MessageBuffer oss_; \
1886  logger->forcedLog(::log4cxx::Level::getFatal(), oss_.str(oss_ << message), LOG4CXX_LOCATION); }} while (0)
1887 #else
1888 #define LOG4CXX_FATAL(logger, message)
1889 #endif
1890 
1898 #define LOG4CXX_L7DLOG(logger, level, key) do { \
1899  if (logger->isEnabledFor(level)) {\
1900  logger->l7dlog(level, key, LOG4CXX_LOCATION); }} while (0)
1901 
1910 #define LOG4CXX_L7DLOG1(logger, level, key, p1) do { \
1911  if (logger->isEnabledFor(level)) {\
1912  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1); }} while (0)
1913 
1923 #define LOG4CXX_L7DLOG2(logger, level, key, p1, p2) do { \
1924  if (logger->isEnabledFor(level)) {\
1925  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2); }} while (0)
1926 
1937 #define LOG4CXX_L7DLOG3(logger, level, key, p1, p2, p3) do { \
1938  if (logger->isEnabledFor(level)) {\
1939  logger->l7dlog(level, key, LOG4CXX_LOCATION, p1, p2, p3); }} while (0)
1940 
1943 #if defined(_MSC_VER)
1944  #pragma warning ( pop )
1945 #endif
1946 
1947 #include <log4cxx/spi/loggerrepository.h>
1948 
1949 #endif //_LOG4CXX_LOGGER_H
A LoggerRepository is used to create and retrieve Loggers.
Definition: loggerrepository.h:47
This Interface is for attaching Appenders to objects.
Definition: appenderattachable.h:39
LogString name
The name of this logger.
Definition: logger.h:86
helpers::ResourceBundlePtr resourceBundle
The resourceBundle for localized messages.
Definition: logger.h:103
LoggerPtr parent
The parent of this logger.
Definition: logger.h:97
Implementation class for Object.
Definition: objectimpl.h:28
Definition: defaultloggerfactory.h:29
const LogString & getName() const
Get the logger name.
Definition: logger.h:638
Definition: pool.h:32
LevelPtr level
The assigned level of this logger.
Definition: logger.h:92
This class is specialized in retrieving loggers by name and also maintaining the logger hierarchy...
Definition: hierarchy.h:55
This class represents the location of a logging statement.
Definition: locationinfo.h:33
bool additive
Additivity is set to true by default, that is children inherit the appenders of their ancestors by de...
Definition: logger.h:118
utility class for objects multi-thread synchronization.
Definition: synchronized.h:33
This is the central class in the log4cxx package.
Definition: logger.h:65
Definition: appender.h:33
void setResourceBundle(const helpers::ResourceBundlePtr &bundle)
Set the resource bundle to be used with localized logging methods.
Definition: logger.h:1486