BIND 10 master, updated. d7c2d4ab317636ed434265d885a433c8e669db10 [trac1040] Further merge issues

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Jun 28 10:48:23 UTC 2011


The branch, master has been updated
       via  d7c2d4ab317636ed434265d885a433c8e669db10 (commit)
       via  3c3ef0445aefddccf5cebab6edb347536e3adc71 (commit)
       via  dd4c4405f56ebbcb74d8f792ad528daf9b2bc79a (commit)
       via  4e025223cedb89d5dff5c250ab3cab42bfeb195e (commit)
       via  d4ef4b9a0cc72eb9d85c6fef4aeb4b2f90b2b590 (commit)
       via  e560672e5119540d6e6860c177a9b969e5a71fb1 (commit)
       via  ebc9aa4dc554ec8aced4413b47a0668f3f5f1da1 (commit)
       via  ddd40bde5412d11fb4d320958f26572797442b74 (commit)
       via  4565ca4899e702da0c515e11d614cddb3f483a7d (commit)
      from  4ad7f97c789c2e2747506b7220bc279898aadeb4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d7c2d4ab317636ed434265d885a433c8e669db10
Author: Stephen Morris <stephen at isc.org>
Date:   Tue Jun 28 10:43:39 2011 +0100

    [trac1040] Further merge issues
    
    Minor issues concerning spurious commas and a missing include file.
    Also, this change fixes a couple of "missing libraries" in other
    parts of the BIND 10 code.

commit 3c3ef0445aefddccf5cebab6edb347536e3adc71
Merge: dd4c4405f56ebbcb74d8f792ad528daf9b2bc79a 4ad7f97c789c2e2747506b7220bc279898aadeb4
Author: Stephen Morris <stephen at isc.org>
Date:   Tue Jun 28 09:57:28 2011 +0100

    [trac1040] Merge branch 'master' into trac1040
    
    Conflicts:
    	src/lib/log/logger_manager.cc
    	src/lib/log/tests/destination_test.sh.in
    	src/lib/log/tests/local_file_test.sh.in
    	src/lib/log/tests/severity_test.sh.in

commit dd4c4405f56ebbcb74d8f792ad528daf9b2bc79a
Author: Stephen Morris <stephen at isc.org>
Date:   Thu Jun 23 11:48:14 2011 +0100

    [trac1040] Update message descriptions after review.

commit 4e025223cedb89d5dff5c250ab3cab42bfeb195e
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 14:23:39 2011 +0100

    [trac1040] Update README file

commit d4ef4b9a0cc72eb9d85c6fef4aeb4b2f90b2b590
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 11:55:17 2011 +0100

    [trac1040] Put messages into alphabetical order
    
    ... and remove the now-redundant spaces between the message ID and
    the text of the message. (With the expansion of message IDs, the
    alignment of the text within the file was destroyed.)

commit e560672e5119540d6e6860c177a9b969e5a71fb1
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 11:47:01 2011 +0100

    [trac1040] Expand message IDs into words separated by underscores
    
    Also change prefix from MSG_ (which is not specific) to LOG_ (which
    identifies the messages as part of the logging code).

commit ebc9aa4dc554ec8aced4413b47a0668f3f5f1da1
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 10:57:42 2011 +0100

    [trac1040] Expand logger implementation message code names
    
    Altered the message code names in the logger implementation messages
    to be in the form of words separated by underscores.  Also updated
    some of the descriptions at the same time.

commit ddd40bde5412d11fb4d320958f26572797442b74
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 10:46:20 2011 +0100

    [trac1040] Remove $PREFIX directive

commit 4565ca4899e702da0c515e11d614cddb3f483a7d
Author: Stephen Morris <stephen at isc.org>
Date:   Wed Jun 22 10:42:05 2011 +0100

    [trac1040] Renamed xxxdef.mes files to xxx_messages.mes
    
    Note: impldef.mes was renamed to logimpl_messages.mes to better
    reflect the contents.

-----------------------------------------------------------------------

Summary of changes:
 src/bin/resolver/tests/Makefile.am               |    1 +
 src/lib/log/Makefile.am                          |    8 +-
 src/lib/log/README                               |  321 +++++++++++++---------
 src/lib/log/compiler/message.cc                  |   10 +-
 src/lib/log/impldef.cc                           |   29 --
 src/lib/log/impldef.h                            |   18 --
 src/lib/log/impldef.mes                          |   38 ---
 src/lib/log/log_messages.cc                      |   63 +++++
 src/lib/log/log_messages.h                       |   35 +++
 src/lib/log/log_messages.mes                     |  146 ++++++++++
 src/lib/log/logger_level.cc                      |    4 +-
 src/lib/log/logger_level_impl.cc                 |    8 +-
 src/lib/log/logger_manager.cc                    |   17 +-
 src/lib/log/logger_manager_impl.cc               |   14 +-
 src/lib/log/logimpl_messages.cc                  |   29 ++
 src/lib/log/logimpl_messages.h                   |   18 ++
 src/lib/log/logimpl_messages.mes                 |   43 +++
 src/lib/log/message_reader.cc                    |   28 +-
 src/lib/log/messagedef.cc                        |   63 -----
 src/lib/log/messagedef.h                         |   35 ---
 src/lib/log/messagedef.mes                       |  131 ---------
 src/lib/log/output_option.cc                     |   11 +-
 src/lib/log/tests/destination_test.sh.in         |   24 +-
 src/lib/log/tests/local_file_test.sh.in          |   38 ++--
 src/lib/log/tests/logger_example.cc              |   32 +-
 src/lib/log/tests/logger_level_unittest.cc       |    2 +-
 src/lib/log/tests/logger_manager_unittest.cc     |   38 ++--
 src/lib/log/tests/logger_support_unittest.cc     |    6 +-
 src/lib/log/tests/logger_unittest.cc             |    2 +-
 src/lib/log/tests/message_dictionary_unittest.cc |    4 +-
 src/lib/log/tests/message_reader_unittest.cc     |   24 +-
 src/lib/log/tests/severity_test.sh.in            |   52 ++--
 src/lib/server_common/tests/Makefile.am          |    2 +
 33 files changed, 688 insertions(+), 606 deletions(-)
 delete mode 100644 src/lib/log/impldef.cc
 delete mode 100644 src/lib/log/impldef.h
 delete mode 100644 src/lib/log/impldef.mes
 create mode 100644 src/lib/log/log_messages.cc
 create mode 100644 src/lib/log/log_messages.h
 create mode 100644 src/lib/log/log_messages.mes
 create mode 100644 src/lib/log/logimpl_messages.cc
 create mode 100644 src/lib/log/logimpl_messages.h
 create mode 100644 src/lib/log/logimpl_messages.mes
 delete mode 100644 src/lib/log/messagedef.cc
 delete mode 100644 src/lib/log/messagedef.h
 delete mode 100644 src/lib/log/messagedef.mes

-----------------------------------------------------------------------
diff --git a/src/bin/resolver/tests/Makefile.am b/src/bin/resolver/tests/Makefile.am
index 7027ae9..c519617 100644
--- a/src/bin/resolver/tests/Makefile.am
+++ b/src/bin/resolver/tests/Makefile.am
@@ -48,6 +48,7 @@ run_unittests_LDADD += $(top_builddir)/src/lib/cache/libcache.la
 run_unittests_LDADD += $(top_builddir)/src/lib/nsas/libnsas.la
 run_unittests_LDADD += $(top_builddir)/src/lib/resolve/libresolve.la
 run_unittests_LDADD += $(top_builddir)/src/lib/acl/libacl.la
+run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
 run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 
 # Note the ordering matters: -Wno-... must follow -Wextra (defined in
diff --git a/src/lib/log/Makefile.am b/src/lib/log/Makefile.am
index 7833e0d..63b1dfb 100644
--- a/src/lib/log/Makefile.am
+++ b/src/lib/log/Makefile.am
@@ -8,7 +8,7 @@ CLEANFILES = *.gcno *.gcda
 lib_LTLIBRARIES = liblog.la
 liblog_la_SOURCES  =
 liblog_la_SOURCES += dummylog.h dummylog.cc
-liblog_la_SOURCES += impldef.cc impldef.h
+liblog_la_SOURCES += logimpl_messages.cc logimpl_messages.h
 liblog_la_SOURCES += log_formatter.h log_formatter.cc
 liblog_la_SOURCES += logger.cc logger.h
 liblog_la_SOURCES += logger_impl.cc logger_impl.h
@@ -21,7 +21,7 @@ liblog_la_SOURCES += logger_name.cc logger_name.h
 liblog_la_SOURCES += logger_specification.h
 liblog_la_SOURCES += logger_support.cc logger_support.h
 liblog_la_SOURCES += macros.h
-liblog_la_SOURCES += messagedef.cc messagedef.h
+liblog_la_SOURCES += log_messages.cc log_messages.h
 liblog_la_SOURCES += message_dictionary.cc message_dictionary.h
 liblog_la_SOURCES += message_exception.h
 liblog_la_SOURCES += message_initializer.cc message_initializer.h
@@ -30,8 +30,8 @@ liblog_la_SOURCES += message_types.h
 liblog_la_SOURCES += output_option.cc output_option.h
 
 EXTRA_DIST  = README
-EXTRA_DIST += impldef.mes
-EXTRA_DIST += messagedef.mes
+EXTRA_DIST += logimpl_messages.mes
+EXTRA_DIST += log_messages.mes
 
 # Note: the ordering matters: -Wno-... must follow -Wextra (defined in
 # B10_CXXFLAGS)
diff --git a/src/lib/log/README b/src/lib/log/README
index 6b4cf11..d854dce 100644
--- a/src/lib/log/README
+++ b/src/lib/log/README
@@ -1,11 +1,12 @@
 This directory holds the first release of the logging system.
 
+
 Basic Ideas
 ===========
 The BIND-10 logging system merges two ideas:
 
 * A hierarchical logging system similar to that used in Java (i.e. log4j)
-* Separation of message definitions and text
+* Separation of message use from message text
 
 
 Hierarchical Logging System
@@ -28,23 +29,26 @@ above, the INFO/Syslog attributes could be associated with the root logger
 while the DEBUG/file attributes are associated with the "cache" logger.
 
 
-Separation of Messages Definitions And Text
-===========================================
-The reason for this is to allow the message text to be overridden by versions
-in a local language.  To do this, each message is identified by an identifier
-e.g. "OPENIN".  Within the program, this is the symbol passed to the logging
-system.  The logger system uses the symbol as an index into a dictionary to
-retrieve the message associated with it (e.g. "unable to open %s for input").
-substitutes any message parameters (in this example, the string that is an
-invalid filename) and logs it to the destination.
+Separation of Messages Use from Message Text
+============================================
+By separating the use of the message from the text associated with this -
+in essence, defining message text in an external file - it is possible to
+replace the supplied text of the messages with a local language version.
 
-In the BIND-10 system, a set of default messages are linked into the
-program.  At run-time. each program reads a message file, updating the
-stored definitions; this updated text is logged.  However, to aid support,
-the message identifier so in the example above, the message finally logged
-would be something like:
+Each message is identified by an identifier e.g. "LOG_WRITE_ERROR".
+Within the program, this is the symbol passed to the logging system.
+The logger system uses the symbol as an index into a dictionary to
+retrieve the message associated with it (e.g. "unable to open %s for
+input").  It then substitutes any message parameters (in this example,
+the name of the file where the write operation failed) and logs it to
+the destination.
 
-    FAC_OPENIN, unable to open a.txt for input
+In BIND-10, a the default text for each message is linked into the
+program.  Each program is able to read a locally-defined message file
+when it starts, updating the stored definitions with site-specific text.
+When the message is logged, the updated text is output. However, the
+message identifier is always included in the output so that the origin
+of the message can be identified even if the text has been changed.
 
 
 Using The System
@@ -52,8 +56,9 @@ Using The System
 The steps in using the system are:
 
 1. Create a message file.  This defines messages by an identification - a
-   mnemonic for the message, typically 6-12 characters long - and a message.
-   The file is described in more detail below.
+   mnemonic for the message, the convention being that these are a few
+   words separated by underscores - and text that explains the message in
+   more detail.  The file is described in more detail below.
 
    Ideally the file should have a file type of ".mes".
 
@@ -73,9 +78,7 @@ The steps in using the system are:
    described in more detail below.
 
 5. To set the debug level and run-time message file, call initLogger (declared
-   in logger_support.h) in the main program unit.  This is a temporary solution
-   for Year 2, and will be replaced at a later date, the information coming
-   from the configuration database.
+   in logger_support.h) in the main program unit.
 
 
 Message Files
@@ -90,16 +93,16 @@ An example file could be:
 -- BEGIN --
 
 # Example message file
-# $ID:$
 
-$PREFIX TEST_
 $NAMESPACE isc::log
 
-% TEST1       message %1 is much too large
-This message is a test for the general message code
+% LOG_UNRECOGNISED_DIRECTIVE line %1: unrecognised directive '%2'
+A line starting with a dollar symbol was found, but the first word on the line
+(shown in the message) was not a recognised message compiler directive.
 
-% UNKNOWN     unknown message
-Issued when the message is unknown.
+% LOG_WRITE_ERROR error writing to %1: %2
+The specified error was encountered by the message compiler when writing to
+the named output file.
 
 -- END --
 
@@ -114,10 +117,8 @@ Points to note:
   a line by themselves - inline comments will be interpreted as part of the
   text of the line.
 
-* Lines starting $ are directives.  At present, two directives are recognised:
-
-  * $PREFIX, which has one optional argument: the string used to prefix symbols.
-    If absent, there is no prefix to the symbols (prefixes are explained below).
+* Lines starting $ are directives.  At present, just one directive is
+  recognised:
 
   * $NAMESPACE, which has one argument: the namespace in which the symbols are
     created.  In the absence of a $NAMESPACE directive, symbols will be put in
@@ -127,10 +128,19 @@ Points to note:
   identification and the message text, the latter including zero or more
   replacement tokens, e.g.
 
-     % TEST  message %1 is larger than the permitted length of %2
+     % LOG_WRITE_ERROR error writing to %1: %2
 
   * There may be zero or more spaces between the leading "%" and the message
-    identification (which, in the example above, is the word "TEST").
+    identification (which, in the example above, is the string
+    "LOG_WRITE_ERROR").
+
+  * The message identification can be any string of letters, digits and
+    underscores, but should not start with a digit.  The convention adopted
+    in BIND 10 is for the first component (before the first underscore) to be
+    a string indicating the origin of the message, and the remainder to
+    describe the message.  So in the example above, the LOG_ indicates that
+    the error originated from the logging library and the "WRITE_ERROR"
+    indicates that there was a problem in a write operation.
 
   * The replacement tokens are the strings "%1", "%2" etc.  When a message
     is logged, these are replaced with the arguments passed to the logging
@@ -147,42 +157,36 @@ Message Compiler
 The message compiler is a program built in the src/log/compiler directory.
 It is invoked by the command:
 
-    message [-h] [-v] <message-file>
+    message [-h] [-v] -p] <message-file>
+
+("-v" prints the version number and exits; "-h" prints brief help text.)  The
+compiler produces source files for C++ and Python.
 
-("-v" prints the version number and exits; "-h" prints brief help text.)
-The message compiler processes the message file to produce two files:
+C++ Files
+---------
+Without the "-p" option, the message compiler processes the message file
+to produce two files:
 
 1) A C++ header file (called <message-file-name>.h) that holds lines of
 the form:
 
    namespace <namespace> {
-   extern const isc::log::MessageID PREFIX_IDENTIFIER;
+   extern const isc::log::MessageID LOG_WRITE_ERROR;
       :
    }
 
 The symbols define the keys in the global message dictionary, with the
 namespace enclosing the symbols set by the $NAMESPACE directive.
 
-The "PREFIX_" part of the symbol name is the string defined in the $PREFIX
-the argument to the directive.  So "$PREFIX MSG_" would prefix the identifier
-ABC with "MSG_" to give the symbol MSG_ABC.  Similarly "$PREFIX E" would
-prefix it with "E" to give the symbol EABC.  If no $PREFIX is given, no
-prefix appears (so the symbol in this example would be ABC).
-
-The prefix is "syntactic sugar".  Generally all symbols in a given message file
-will be prefixed with the same set of letters.  By extracting these into
-a separate prefix, it becomes easier to disambiguate the different symbols.
-
-There may be multiple $PREFIX directives in a file.  A $PREFIX directive applies
-to all message definitions between it an the next $PREFIX directive.  A $PREFIX
-directive with no arguments clears the current prefix.
+(This is the reason for the restriction on message identifiers - they
+have to be valid C++ symbol names.)
 
 2) A C++ source file (called <message-file-name>.cc) that holds the definitions
 of the global symbols and code to insert the symbols and messages into the map.
 
 Symbols are defined to be equal to strings holding the identifier, e.g.
 
-   extern const isc::log::MessageID MSG_DUPLNS = "MSG_DUPLNS";
+   extern const isc::log::MessageID LOG_WRITE_ERROR = "LOG_WRITE_ERROR";
 
 (The implementation allows symbols to be compared.  However, use of strings
 should not be assumed - a future implementation may change this.)
@@ -208,16 +212,29 @@ A check is made as each is added; if the identifier already exists, it is
 added to "overflow" vector; the vector is printed to the main logging output
 when logging is finally enabled (to indicate a programming error).
 
+Python Files
+------------
+If the "-p" option is given, the compiler produces a Python module defining
+the messages.  The format of this is:
+
+import isc.log
+    :
+LOG_WRITE_ERROR = isc.log.create_message("LOG_WRITE_ERROR",
+        "error writing to %1 : %2")
 
-Using the Logging
-=================
-To use the current version of the logging:
+(The definition is output on one line - it is split across two lines in this
+document for readability.)
 
+The module can be imported into other Python code, and messages logged
+in a similar way to C++ using the Python logging library.
+
+Using the Logging - C++
+=======================
 1. Build message header file and source file as describe above.
 
 2. The main program unit should include a call to isc::log::initLogger()
-   (defined in logger_support.h) to set the logging severity, debug log level,
-   and external message file:
+   (defined in logger_support.h) to set the logging severity, debug log
+   level, and external message file:
 
    a) The logging severity is one of the enum defined in logger.h, i.e.
 
@@ -228,88 +245,134 @@ To use the current version of the logging:
         isc::log::FATAL
         isc::log::NONE
 
-   b) The debug log level is only interpreted when the severity is DEBUG and
-      is an integer ranging from 0 to 99.  0 should be used for the
-      highest-level debug messages and 99 for the lowest-level (and typically
-      more verbose) messages.
+   b) The debug log level is only interpreted when the severity is
+      DEBUG and is an integer ranging from 0 to 99.  0 should be used
+      for the highest-level debug messages and 99 for the lowest-level
+      (and typically more verbose) messages.
+
+   c) The external message file.  If present, this is the same as a
+      standard message file, although it should not include any
+      directives. (A single directive of a particular type will be
+      ignored; multiple directives will cause the read of the file to
+      fail with an error.)
+
+   The settings remain in effect until the logging configuration is read,
+   and so provide the default logging during program initialization.
+
+3. Declare a logger through which the message will be logged.
+
+       isc::log::Logger logger("name");
+
+   The string passed to the constructor is the name of the logger (it
+   can be any string) and is used when configuring it.  Loggers with
+   the same name share the same configuration.
 
-   c) The external message file.  If present, this is the same as a standard
-      message file, although it should not include any directives. (A single
-      directive of a particular type will be ignored; multiple directives will
-      cause the read of the file to fail with an error.)
+4. Issue logging calls using supplied macros in "log/macros.h", e.g.
 
-   The settings remain in effect until the logging configuration is read, and
-   so provide the default logging during program initialization.
+       LOG_ERROR(logger, LOG_WRITE_ERROR).arg("output.txt");
 
-3. Issue logging calls using supplied macros in "log/macros.h", e.g.
+   (The macros are more efficient that calls to the methods on the logger
+   class: they avoid the overhead of evaluating the parameters to arg()
+   if the settings are such that the message is not going to be output.)
 
-       LOG_ERROR(logger, DPS_NSTIMEOUT).arg("isc.org");
+Using the Logging - Python
+==========================
+1. Build message module as describe above.
 
-   (The macros are more efficient that calls to the methods on the logger class:
-   they avoid the overhead of evaluating the parameters to arg() if the
-   settings are such that the message is not going to be output.)
+2. The main program unit should include a call to isc.log.init() to
+   set the to set the logging severity, debug log level, and external
+   message file:
 
-   Note: in the example above we might have defined the symbol in the message
-   file with something along the lines of:
+   a) The logging severity is one of the strings:
+
+        DEBUG
+        INFO
+        WARN
+        ERROR
+        FATAL
+        NONE
+
+   b) The debug log level is only interpreted when the severity is
+      DEBUG and is an integer ranging from 0 to 99.  0 should be used
+      for the highest-level debug messages and 99 for the lowest-level
+      (and typically more verbose) messages.
+
+   c) The external message file.  If present, this is the same as a
+      standard message file, although it should not include any
+      directives. (Any that are there will be ignored.)
+
+   The settings remain in effect until the logging configuration is read,
+   and so provide the default logging during program initialization.
+
+3. Declare a logger through which the message will be logged.
+
+       isc.log.Logger logger("name")
+
+   The string passed to the constructor is the name of the logger (it
+   can be any string) and is used when configuring it.  Loggers with
+   the same name share the same configuration.
+
+4. Issue calls to the logging methods:
+
+       logger.error(LOG_WRITE_ERROR, "output.txt");
 
-       $PREFIX DPS_
-           :
-       NSTIMEOUT  queries to all nameservers for %1 have timed out
 
 Severity Guidelines
 ===================
-When using logging, the question arises, what severity should a message be
-logged at?  The following is a suggestion - as always, the decision must be
-made in the context of which the message is logged.
+When using logging, the question arises, what severity should a message
+be logged at?  The following is a suggestion - as always, the decision
+must be made in the context of which the message is logged.
 
-One thing that should always be borne in mind is whether the logging could
-be used as a vector for a DOS attack.  For example, if a warning message is
-logged every time an invalid packet is received, an attacker could simply send
-large numbers of invalid packets.  (Of course, warnings could be disabled (or
-just warnings for that that particular logger), but nevertheless the message
-is an attack vector.)
+One thing that should always be borne in mind is whether the logging
+could be used as a vector for a DOS attack.  For example, if a warning
+message is logged every time an invalid packet is received, an attacker
+could simply send large numbers of invalid packets.  (Of course, warnings
+could be disabled (or just warnings for that that particular logger),
+but nevertheless the message is an attack vector.)
 
 FATAL
 -----
-The program has encountered an error that is so severe that it cannot continue
-(or there is no point in continuing).  When a fatal error has been logged,
-the program will usually exit immediately (or shortly afterwards) after
-dumping some diagnostic information.
+The program has encountered an error that is so severe that it cannot
+continue (or there is no point in continuing).  When a fatal error
+has been logged, the program will usually exit immediately (or shortly
+afterwards) after dumping some diagnostic information.
 
 ERROR
 -----
-Something has happened such that the program can continue but the results
-for the current (or future) operations cannot be guaranteed to be correct,
-or the results will be correct but the service is impaired.  For example,
-the program started but attempts to open one or more network interfaces failed.
+Something has happened such that the program can continue but the
+results for the current (or future) operations cannot be guaranteed to
+be correct, or the results will be correct but the service is impaired.
+For example, the program started but attempts to open one or more network
+interfaces failed.
 
 WARN
 ----
 An unusual event  happened.  Although the program will continue working
-normally, the event was sufficiently out of the ordinary to warrant drawing
-attention to it.  For example, at program start-up a zone was loaded that
-contained no resource records,
+normally, the event was sufficiently out of the ordinary to warrant
+drawing attention to it.  For example, at program start-up a zone was
+loaded that contained no resource records,
 
 INFO
 ----
 A normal but significant event has occurred that should be recorded,
-e.g. the program has started or is just about to terminate, a new zone has
-been created, etc.
+e.g. the program has started or is just about to terminate, a new zone
+has been created, etc.
 
 DEBUG
 -----
 This severity is only enabled on for debugging purposes.  A debug level is
 associated with debug messages, level 0 (the default) being for high-level
-messages and level 99 (the maximum) for the lowest level.  How the messages
-are distributed between the levels is up to the developer.  So if debugging
-the NSAS (for example), a level 0 message might record the creation of a new
-zone, a level 10 recording a timeout when trying to get a nameserver address,
-but a level 50 would record every query for an address. (And we might add
-level 70 to record every update of the RTT.)
-
-Note that like severities, levels are cumulative; so if level 25 is set as the
-debug level, all debug levels from 0 to 25 will be output.  In fact, it is
-probably easier to visualise the debug levels as part of the severity system:
+messages and level 99 (the maximum) for the lowest level.  How the
+messages are distributed between the levels is up to the developer.
+So if debugging the NSAS (for example), a level 0 message might record
+the creation of a new zone, a level 10 recording a timeout when trying
+to get a nameserver address, but a level 50 would record every query for
+an address. (And we might add level 70 to record every update of the RTT.)
+
+Note that like severities, levels are cumulative; so if level 25 is
+set as the debug level, all debug levels from 0 to 25 will be output.
+In fact, it is probably easier to visualise the debug levels as part of
+the severity system:
 
     FATAL                High
     ERROR
@@ -325,38 +388,34 @@ levels above it - will be logged.
 
 Logging Sources v Logging Severities
 ------------------------------------
-When logging events, make a distinction between events related to the server
-and events related to DNS messages received.  Caution needs to be exercised
-with the latter as, if the logging is enabled in the normal course of events,
-such logging could be a denial of service vector. For example, suppose that
-the main authoritative service logger were to log both zone loading and
-unloading as INFO and a warning message if it received an invalid packet. An
-attacker could make the INFO messages unusable by flooding the server with
-malformed packets.
+When logging events, make a distinction between events related to the
+server and events related to DNS messages received.  Caution needs to
+be exercised with the latter as, if the logging is enabled in the normal
+course of events, such logging could be a denial of service vector. For
+example, suppose that the main authoritative service logger were to
+log both zone loading and unloading as INFO and a warning message if
+it received an invalid packet. An attacker could make the INFO messages
+unusable by flooding the server with malformed packets.
 
 There are two approaches to get round this:
 
 a) Make the logging of packet-dependent events a DEBUG-severity message.
-DEBUG is not enabled by default, so these events will not be recorded unless
-DEBUG is specifically chosen.
+DEBUG is not enabled by default, so these events will not be recorded
+unless DEBUG is specifically chosen.
 
 b) Record system-related and packet-related messages via different loggers
-(e.g.  in the example given, server events could be logged using the logger
-"auth" and packet-related events at that level logged using the logger
-"pkt-auth".)  As the loggers are independent and the severity levels
-independent, fine-tuning of what and what is not recorded can be achieved.
+(e.g.  in the example given, server events could be logged using the
+logger "auth" and packet-related events at that level logged using the
+logger "pkt-auth".)  As the loggers are independent and the severity
+levels independent, fine-tuning of what and what is not recorded can
+be achieved.
 
 
 Notes
 =====
 The message compiler is written in C++ (instead of Python) because it
 contains a component that reads the message file.  This component is used
-in both the message compiler and the server; in the server it is used when
-the server starts up (or when triggered by a command) to read in a message
-file to overwrite the internal dictionary.  Writing it in C++ means there
-is only one piece of code that does this functionality.
-
-
-Outstanding Issues
-==================
-* Ability to configure system according to configuration database.
+in both the message compiler and the server; in the server it is used
+when the server starts up (or when triggered by a command) to read in
+a message file to overwrite the internal dictionary.  Writing it in C++
+means there is only one piece of code that does this functionality.
diff --git a/src/lib/log/compiler/message.cc b/src/lib/log/compiler/message.cc
index 53a24ee..68335dc 100644
--- a/src/lib/log/compiler/message.cc
+++ b/src/lib/log/compiler/message.cc
@@ -28,10 +28,10 @@
 #include <util/filename.h>
 #include <util/strutil.h>
 
+#include <log/log_messages.h>
 #include <log/message_dictionary.h>
 #include <log/message_exception.h>
 #include <log/message_reader.h>
-#include <log/messagedef.h>
 
 #include <log/logger.h>
 
@@ -306,7 +306,7 @@ writeHeaderFile(const string& file, const vector<string>& ns_components,
     ofstream hfile(header_file.fullName().c_str());
 
     if (hfile.fail()) {
-        throw MessageException(MSG_OPENOUT, header_file.fullName(),
+        throw MessageException(LOG_OPEN_OUTPUT_FAIL, header_file.fullName(),
             strerror(errno));
     }
 
@@ -340,7 +340,7 @@ writeHeaderFile(const string& file, const vector<string>& ns_components,
 
     // Report errors (if any) and exit
     if (hfile.fail()) {
-        throw MessageException(MSG_WRITERR, header_file.fullName(),
+        throw MessageException(LOG_WRITE_ERROR, header_file.fullName(),
             strerror(errno));
     }
 
@@ -394,7 +394,7 @@ writeProgramFile(const string& file, const vector<string>& ns_components,
     ofstream ccfile(program_file.fullName().c_str());
 
     if (ccfile.fail()) {
-        throw MessageException(MSG_OPENOUT, program_file.fullName(),
+        throw MessageException(LOG_OPEN_OUTPUT_FAIL, program_file.fullName(),
             strerror(errno));
     }
 
@@ -452,7 +452,7 @@ writeProgramFile(const string& file, const vector<string>& ns_components,
 
     // Report errors (if any) and exit
     if (ccfile.fail()) {
-        throw MessageException(MSG_WRITERR, program_file.fullName(),
+        throw MessageException(LOG_WRITE_ERROR, program_file.fullName(),
             strerror(errno));
     }
 
diff --git a/src/lib/log/impldef.cc b/src/lib/log/impldef.cc
deleted file mode 100644
index 087ebea..0000000
--- a/src/lib/log/impldef.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-// File created from impldef.mes on Wed Jun  1 10:32:57 2011
-
-#include <cstddef>
-#include <log/message_types.h>
-#include <log/message_initializer.h>
-
-namespace isc {
-namespace log {
-
-extern const isc::log::MessageID LOGIMPL_ABOVEDBGMAX = "LOGIMPL_ABOVEDBGMAX";
-extern const isc::log::MessageID LOGIMPL_BADDEBUG = "LOGIMPL_BADDEBUG";
-extern const isc::log::MessageID LOGIMPL_BELOWDBGMIN = "LOGIMPL_BELOWDBGMIN";
-
-} // namespace log
-} // namespace isc
-
-namespace {
-
-const char* values[] = {
-    "LOGIMPL_ABOVEDBGMAX", "debug level of %1 is too high and will be set to the maximum of %2",
-    "LOGIMPL_BADDEBUG", "debug string is '%1': must be of the form DEBUGn",
-    "LOGIMPL_BELOWDBGMIN", "debug level of %1 is too low and will be set to the minimum of %2",
-    NULL
-};
-
-const isc::log::MessageInitializer initializer(values);
-
-} // Anonymous namespace
-
diff --git a/src/lib/log/impldef.h b/src/lib/log/impldef.h
deleted file mode 100644
index 7c70996..0000000
--- a/src/lib/log/impldef.h
+++ /dev/null
@@ -1,18 +0,0 @@
-// File created from impldef.mes on Wed Jun  1 10:32:57 2011
-
-#ifndef __IMPLDEF_H
-#define __IMPLDEF_H
-
-#include <log/message_types.h>
-
-namespace isc {
-namespace log {
-
-extern const isc::log::MessageID LOGIMPL_ABOVEDBGMAX;
-extern const isc::log::MessageID LOGIMPL_BADDEBUG;
-extern const isc::log::MessageID LOGIMPL_BELOWDBGMIN;
-
-} // namespace log
-} // namespace isc
-
-#endif // __IMPLDEF_H
diff --git a/src/lib/log/impldef.mes b/src/lib/log/impldef.mes
deleted file mode 100644
index 93e9fab..0000000
--- a/src/lib/log/impldef.mes
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# \brief Logger Implementation Messages
-#
-# This holds messages generated by the underlying logger implementation.  They
-# are likely to be specific to that implementation, and may well change if the
-# underlying implementation is changed.  For that reason, they have been put
-# in a separate file.
-
-$PREFIX LOGIMPL_
-$NAMESPACE isc::log
-
-% ABOVEDBGMAX   debug level of %1 is too high and will be set to the maximum of %2
-A message from the underlying logger implementation code, the debug level
-(as set by the string DEBGUGn) is above the maximum allowed value and has
-been reduced to that value.
-
-% BADDEBUG      debug string is '%1': must be of the form DEBUGn
-The string indicating the extended logging level (used by the underlying
-logger implementation code) is not of the stated form.  In particular,
-it starts DEBUG but does not end with an integer.
-
-% BELOWDBGMIN   debug level of %1 is too low and will be set to the minimum of %2
-A message from the underlying logger implementation code, the debug level
-(as set by the string DEBGUGn) is below the minimum allowed value and has
-been increased to that value.
diff --git a/src/lib/log/log_messages.cc b/src/lib/log/log_messages.cc
new file mode 100644
index 0000000..a515959
--- /dev/null
+++ b/src/lib/log/log_messages.cc
@@ -0,0 +1,63 @@
+// File created from log_messages.mes on Wed Jun 22 11:54:57 2011
+
+#include <cstddef>
+#include <log/message_types.h>
+#include <log/message_initializer.h>
+
+namespace isc {
+namespace log {
+
+extern const isc::log::MessageID LOG_BAD_DESTINATION = "LOG_BAD_DESTINATION";
+extern const isc::log::MessageID LOG_BAD_SEVERITY = "LOG_BAD_SEVERITY";
+extern const isc::log::MessageID LOG_BAD_STREAM = "LOG_BAD_STREAM";
+extern const isc::log::MessageID LOG_DUPLICATE_MESSAGE_ID = "LOG_DUPLICATE_MESSAGE_ID";
+extern const isc::log::MessageID LOG_DUPLICATE_NAMESPACE = "LOG_DUPLICATE_NAMESPACE";
+extern const isc::log::MessageID LOG_INPUT_OPEN_FAIL = "LOG_INPUT_OPEN_FAIL";
+extern const isc::log::MessageID LOG_INVALID_MESSAGE_ID = "LOG_INVALID_MESSAGE_ID";
+extern const isc::log::MessageID LOG_NAMESPACE_EXTRA_ARGS = "LOG_NAMESPACE_EXTRA_ARGS";
+extern const isc::log::MessageID LOG_NAMESPACE_INVALID_ARG = "LOG_NAMESPACE_INVALID_ARG";
+extern const isc::log::MessageID LOG_NAMESPACE_NO_ARGS = "LOG_NAMESPACE_NO_ARGS";
+extern const isc::log::MessageID LOG_NO_MESSAGE_ID = "LOG_NO_MESSAGE_ID";
+extern const isc::log::MessageID LOG_NO_MESSAGE_TEXT = "LOG_NO_MESSAGE_TEXT";
+extern const isc::log::MessageID LOG_NO_SUCH_MESSAGE = "LOG_NO_SUCH_MESSAGE";
+extern const isc::log::MessageID LOG_OPEN_OUTPUT_FAIL = "LOG_OPEN_OUTPUT_FAIL";
+extern const isc::log::MessageID LOG_PREFIX_EXTRA_ARGS = "LOG_PREFIX_EXTRA_ARGS";
+extern const isc::log::MessageID LOG_PREFIX_INVALID_ARG = "LOG_PREFIX_INVALID_ARG";
+extern const isc::log::MessageID LOG_READING_LOCAL_FILE = "LOG_READING_LOCAL_FILE";
+extern const isc::log::MessageID LOG_READ_ERROR = "LOG_READ_ERROR";
+extern const isc::log::MessageID LOG_UNRECOGNISED_DIRECTIVE = "LOG_UNRECOGNISED_DIRECTIVE";
+extern const isc::log::MessageID LOG_WRITE_ERROR = "LOG_WRITE_ERROR";
+
+} // namespace log
+} // namespace isc
+
+namespace {
+
+const char* values[] = {
+    "LOG_BAD_DESTINATION", "unrecognized log destination: %1",
+    "LOG_BAD_SEVERITY", "unrecognized log severity: %1",
+    "LOG_BAD_STREAM", "bad log console output stream: %1",
+    "LOG_DUPLICATE_MESSAGE_ID", "duplicate message ID (%1) in compiled code",
+    "LOG_DUPLICATE_NAMESPACE", "line %1: duplicate $NAMESPACE directive found",
+    "LOG_INPUT_OPEN_FAIL", "unable to open message file %1 for input: %2",
+    "LOG_INVALID_MESSAGE_ID", "line %1: invalid message identification '%2'",
+    "LOG_NAMESPACE_EXTRA_ARGS", "line %1: $NAMESPACE directive has too many arguments",
+    "LOG_NAMESPACE_INVALID_ARG", "line %1: $NAMESPACE directive has an invalid argument ('%2')",
+    "LOG_NAMESPACE_NO_ARGS", "line %1: no arguments were given to the $NAMESPACE directive",
+    "LOG_NO_MESSAGE_ID", "line %1: message definition line found without a message ID",
+    "LOG_NO_MESSAGE_TEXT", "line %1: line found containing a message ID ('%2') and no text",
+    "LOG_NO_SUCH_MESSAGE", "could not replace message text for '%1': no such message",
+    "LOG_OPEN_OUTPUT_FAIL", "unable to open %1 for output: %2",
+    "LOG_PREFIX_EXTRA_ARGS", "line %1: $PREFIX directive has too many arguments",
+    "LOG_PREFIX_INVALID_ARG", "line %1: $PREFIX directive has an invalid argument ('%2')",
+    "LOG_READING_LOCAL_FILE", "reading local message file %1",
+    "LOG_READ_ERROR", "error reading from message file %1: %2",
+    "LOG_UNRECOGNISED_DIRECTIVE", "line %1: unrecognised directive '%2'",
+    "LOG_WRITE_ERROR", "error writing to %1: %2",
+    NULL
+};
+
+const isc::log::MessageInitializer initializer(values);
+
+} // Anonymous namespace
+
diff --git a/src/lib/log/log_messages.h b/src/lib/log/log_messages.h
new file mode 100644
index 0000000..476f686
--- /dev/null
+++ b/src/lib/log/log_messages.h
@@ -0,0 +1,35 @@
+// File created from log_messages.mes on Wed Jun 22 11:54:57 2011
+
+#ifndef __LOG_MESSAGES_H
+#define __LOG_MESSAGES_H
+
+#include <log/message_types.h>
+
+namespace isc {
+namespace log {
+
+extern const isc::log::MessageID LOG_BAD_DESTINATION;
+extern const isc::log::MessageID LOG_BAD_SEVERITY;
+extern const isc::log::MessageID LOG_BAD_STREAM;
+extern const isc::log::MessageID LOG_DUPLICATE_MESSAGE_ID;
+extern const isc::log::MessageID LOG_DUPLICATE_NAMESPACE;
+extern const isc::log::MessageID LOG_INPUT_OPEN_FAIL;
+extern const isc::log::MessageID LOG_INVALID_MESSAGE_ID;
+extern const isc::log::MessageID LOG_NAMESPACE_EXTRA_ARGS;
+extern const isc::log::MessageID LOG_NAMESPACE_INVALID_ARG;
+extern const isc::log::MessageID LOG_NAMESPACE_NO_ARGS;
+extern const isc::log::MessageID LOG_NO_MESSAGE_ID;
+extern const isc::log::MessageID LOG_NO_MESSAGE_TEXT;
+extern const isc::log::MessageID LOG_NO_SUCH_MESSAGE;
+extern const isc::log::MessageID LOG_OPEN_OUTPUT_FAIL;
+extern const isc::log::MessageID LOG_PREFIX_EXTRA_ARGS;
+extern const isc::log::MessageID LOG_PREFIX_INVALID_ARG;
+extern const isc::log::MessageID LOG_READING_LOCAL_FILE;
+extern const isc::log::MessageID LOG_READ_ERROR;
+extern const isc::log::MessageID LOG_UNRECOGNISED_DIRECTIVE;
+extern const isc::log::MessageID LOG_WRITE_ERROR;
+
+} // namespace log
+} // namespace isc
+
+#endif // __LOG_MESSAGES_H
diff --git a/src/lib/log/log_messages.mes b/src/lib/log/log_messages.mes
new file mode 100644
index 0000000..697ac92
--- /dev/null
+++ b/src/lib/log/log_messages.mes
@@ -0,0 +1,146 @@
+# Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+# \brief Message Utility Message File
+#
+# This is the source of the set of messages generated by the message and
+# logging components.  The associated .h and .cc files are created by hand from
+# this file though and are not built during the build process; this is to avoid
+# the chicken-and-egg situation where we need the files to build the message
+# compiler, yet we need the compiler to build the files.
+
+$NAMESPACE isc::log
+
+% LOG_BAD_DESTINATION unrecognized log destination: %1
+A logger destination value was given that was not recognized. The
+destination should be one of "console", "file", or "syslog".
+
+% LOG_BAD_SEVERITY unrecognized log severity: %1
+A logger severity value was given that was not recognized. The severity
+should be one of "DEBUG", "INFO", "WARN", "ERROR", or "FATAL".
+
+% LOG_BAD_STREAM bad log console output stream: %1
+A log console output stream was given that was not recognized. The output
+stream should be one of "stdout", or "stderr"
+
+% LOG_DUPLICATE_MESSAGE_ID duplicate message ID (%1) in compiled code
+During start-up, BIND10 detected that the given message identification had
+been defined multiple times in the BIND10 code.
+
+This has no ill-effects other than the possibility that an erronous
+message may be logged.  However, as it is indicative of a programming
+error, please log a bug report.
+
+% LOG_DUPLICATE_NAMESPACE line %1: duplicate $NAMESPACE directive found
+When reading a message file, more than one $NAMESPACE directive was found.
+Such a condition is regarded as an error and the read will be abandoned.
+
+% LOG_INPUT_OPEN_FAIL unable to open message file %1 for input: %2
+The program was not able to open the specified input message file for
+the reason given.
+
+% LOG_INVALID_MESSAGE_ID line %1: invalid message identification '%2'
+An invalid message identification (ID) has been found during the read of
+a message file.  Message IDs should comprise only alphanumeric characters
+and the underscore, and should not start with a digit.
+
+% LOG_NAMESPACE_EXTRA_ARGS line %1: $NAMESPACE directive has too many arguments
+The $NAMESPACE directive in a message file takes a single argument, a
+namespace in which all the generated symbol names are placed.  This error
+is generated when the compiler finds a $NAMESPACE directive with more
+than one argument.
+
+% LOG_NAMESPACE_INVALID_ARG line %1: $NAMESPACE directive has an invalid argument ('%2')
+The $NAMESPACE argument in a message file should be a valid C++ namespace.
+This message is output if the simple check on the syntax of the string
+carried out by the reader fails.
+
+% LOG_NAMESPACE_NO_ARGS line %1: no arguments were given to the $NAMESPACE directive
+The $NAMESPACE directive in a message file takes a single argument,
+a C++ namespace in which all the generated symbol names are placed.
+This error is generated when the compiler finds a $NAMESPACE directive
+with no arguments.
+
+% LOG_NO_MESSAGE_ID line %1: message definition line found without a message ID
+Within a message file, message are defined by lines starting with a "%".
+The rest of the line should comprise the message ID and text describing
+the message.  This error indicates the message compiler found a line in
+the message file comprising just the "%" and nothing else.
+
+% LOG_NO_MESSAGE_TEXT line %1: line found containing a message ID ('%2') and no text
+Within a message file, message are defined by lines starting with a "%".
+The rest of the line should comprise the message ID and text describing
+the message.  This error indicates the message compiler found a line
+in the message file comprising just the "%" and message identification,
+but no text.
+
+% LOG_NO_SUCH_MESSAGE could not replace message text for '%1': no such message
+During start-up a local message file was read.  A line with the listed
+message identification was found in the file, but the identification is
+not one contained in the compiled-in message dictionary.  This message
+may appear a number of times in the file, once for every such unknown
+message identification.
+
+There may be several reasons why this message may appear:
+
+- The message ID has been mis-spelled in the local message file.
+
+- The program outputting the message may not use that particular message
+(e.g. it originates in a module not used by the program.)
+
+- The local file was written for an earlier version of the BIND10 software
+and the later version no longer generates that message.
+
+Whatever the reason, there is no impact on the operation of BIND10.
+
+% LOG_OPEN_OUTPUT_FAIL unable to open %1 for output: %2
+Originating within the logging code, the program was not able to open
+the specified output file for the reason given.
+
+% LOG_PREFIX_EXTRA_ARGS line %1: $PREFIX directive has too many arguments
+Within a message file, the $PREFIX directive takes a single argument,
+a prefix to be added to the symbol names when a C++ file is created.
+This error is generated when the compiler finds a $PREFIX directive with
+more than one argument.
+
+Note: the $PREFIX directive is deprecated and will be removed in a future
+version of BIND10.
+
+% LOG_PREFIX_INVALID_ARG line %1: $PREFIX directive has an invalid argument ('%2')
+Within a message file, the $PREFIX directive takes a single argument,
+a prefix to be added to the symbol names when a C++ file is created.
+As such, it must adhere to restrictions on C++ symbol names (e.g. may
+only contain alphanumeric characters or underscores, and may nor start
+with a digit).  A $PREFIX directive was found with an argument (given
+in the message) that violates those restictions.
+
+Note: the $PREFIX directive is deprecated and will be removed in a future
+version of BIND10.
+
+% LOG_READING_LOCAL_FILE reading local message file %1
+This is an informational message output by BIND10 when it starts to read
+a local message file.  (A local message file may replace the text of
+one of more messages; the ID of the message will not be changed though.)
+
+% LOG_READ_ERROR error reading from message file %1: %2
+The specified error was encountered reading from the named message file.
+
+% LOG_UNRECOGNISED_DIRECTIVE line %1: unrecognised directive '%2'
+Within a message file, a line starting with a dollar symbol was found
+(indicating the presence of a directive) but the first word on the line
+(shown in the message) was not recognised.
+
+% LOG_WRITE_ERROR error writing to %1: %2
+The specified error was encountered by the message compiler when writing
+to the named output file.
diff --git a/src/lib/log/logger_level.cc b/src/lib/log/logger_level.cc
index 5f74eb3..abac5be 100644
--- a/src/lib/log/logger_level.cc
+++ b/src/lib/log/logger_level.cc
@@ -14,7 +14,7 @@
 
 #include <log/logger_level.h>
 #include <log/macros.h>
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 
 #include <boost/algorithm/string.hpp>
 
@@ -38,7 +38,7 @@ getSeverity(const std::string& sev_str) {
         return isc::log::NONE;
     } else {
         Logger logger("log");
-        LOG_ERROR(logger, MSG_BADSEVERITY).arg(sev_str);
+        LOG_ERROR(logger, LOG_BAD_SEVERITY).arg(sev_str);
         return isc::log::INFO;
     }
 }
diff --git a/src/lib/log/logger_level_impl.cc b/src/lib/log/logger_level_impl.cc
index d6d8ed7..397f6d4 100644
--- a/src/lib/log/logger_level_impl.cc
+++ b/src/lib/log/logger_level_impl.cc
@@ -19,9 +19,9 @@
 
 #include <log4cplus/logger.h>
 
-#include <log/impldef.h>
 #include <log/logger_level.h>
 #include <log/logger_level_impl.h>
+#include <log/logimpl_messages.h>
 #include <log/macros.h>
 
 using namespace log4cplus;
@@ -157,12 +157,12 @@ LoggerLevelImpl::logLevelFromString(const log4cplus::tstring& level) {
                 try {
                     int dbglevel = boost::lexical_cast<int>(name.substr(5));
                     if (dbglevel < MIN_DEBUG_LEVEL) {
-                        LOG_WARN(logger, LOGIMPL_BELOWDBGMIN).arg(dbglevel)
+                        LOG_WARN(logger, LOGIMPL_BELOW_MIN_DEBUG).arg(dbglevel)
                             .arg(MIN_DEBUG_LEVEL);
                         dbglevel = MIN_DEBUG_LEVEL;
 
                     } else if (dbglevel > MAX_DEBUG_LEVEL) {
-                        LOG_WARN(logger, LOGIMPL_ABOVEDBGMAX).arg(dbglevel)
+                        LOG_WARN(logger, LOGIMPL_ABOVE_MAX_DEBUG).arg(dbglevel)
                             .arg(MAX_DEBUG_LEVEL);
                         dbglevel = MAX_DEBUG_LEVEL;
 
@@ -170,7 +170,7 @@ LoggerLevelImpl::logLevelFromString(const log4cplus::tstring& level) {
                     return convertFromBindLevel(Level(DEBUG, dbglevel));
                 }
                 catch (boost::bad_lexical_cast&) {
-                    LOG_ERROR(logger, LOGIMPL_BADDEBUG).arg(name);
+                    LOG_ERROR(logger, LOGIMPL_BAD_DEBUG_STRING).arg(name);
                     return (NOT_SET_LOG_LEVEL);
                 }
             }
diff --git a/src/lib/log/logger_manager.cc b/src/lib/log/logger_manager.cc
index 4d56e4b..70e0d6f 100644
--- a/src/lib/log/logger_manager.cc
+++ b/src/lib/log/logger_manager.cc
@@ -15,20 +15,19 @@
 #include <algorithm>
 #include <vector>
 
-#include <log/logger_level.h>
-#include <log/logger_manager_impl.h>
+#include <log/logger.h>
 #include <log/logger_manager.h>
+#include <log/logger_manager_impl.h>
 #include <log/logger_name.h>
 #include <log/logger_support.h>
-#include <log/messagedef.h>
+#include <log/log_messages.h>
+#include <log/macros.h>
 #include <log/message_dictionary.h>
 #include <log/message_exception.h>
 #include <log/message_initializer.h>
+#include <log/message_initializer.h>
 #include <log/message_reader.h>
 #include <log/message_types.h>
-#include <log/macros.h>
-#include <log/messagedef.h>
-#include <log/message_initializer.h>
 
 using namespace std;
 
@@ -125,7 +124,7 @@ LoggerManager::init(const std::string& root, isc::log::Severity severity,
         sort(duplicates.begin(), duplicates.end());
         for (vector<string>::iterator i = duplicates.begin();
              i != duplicates.end(); ++i) {
-            LOG_WARN(logger, MSG_DUPMSGID).arg(*i);
+            LOG_WARN(logger, LOG_DUPLICATE_MESSAGE_ID).arg(*i);
         }
 
     }
@@ -147,7 +146,7 @@ LoggerManager::readLocalMessageFile(const char* file) {
     MessageReader reader(&dictionary);
     try {
 
-        logger.info(MSG_RDLOCMES).arg(file);
+        logger.info(LOG_READING_LOCAL_FILE).arg(file);
         reader.readFile(file, MessageReader::REPLACE);
 
         // File successfully read.  As each message in the file is supposed to
@@ -158,7 +157,7 @@ LoggerManager::readLocalMessageFile(const char* file) {
         for (MessageReader::MessageIDCollection::const_iterator
             i = unknown.begin(); i != unknown.end(); ++i) {
             string message_id = boost::lexical_cast<string>(*i);
-                logger.warn(MSG_IDNOTFND).arg(message_id);
+                logger.warn(LOG_NO_SUCH_MESSAGE).arg(message_id);
         }
     }
     catch (MessageException& e) {
diff --git a/src/lib/log/logger_manager_impl.cc b/src/lib/log/logger_manager_impl.cc
index 92806d0..d69cec8 100644
--- a/src/lib/log/logger_manager_impl.cc
+++ b/src/lib/log/logger_manager_impl.cc
@@ -21,13 +21,13 @@
 #include <log4cplus/fileappender.h>
 #include <log4cplus/syslogappender.h>
 
-#include "log/logger.h"
-#include "log/logger_level_impl.h"
-#include "log/logger_manager.h"
-#include "log/logger_manager_impl.h"
-#include "log/logger_name.h"
-#include "log/logger_specification.h"
-#include "log/messagedef.h"
+#include <log/logger.h>
+#include <log/logger_level_impl.h>
+#include <log/logger_manager.h>
+#include <log/logger_manager_impl.h>
+#include <log/log_messages.h>
+#include <log/logger_name.h>
+#include <log/logger_specification.h>
 
 using namespace std;
 
diff --git a/src/lib/log/logimpl_messages.cc b/src/lib/log/logimpl_messages.cc
new file mode 100644
index 0000000..ca8552e
--- /dev/null
+++ b/src/lib/log/logimpl_messages.cc
@@ -0,0 +1,29 @@
+// File created from logimpl_messages.mes on Wed Jun 22 10:57:02 2011
+
+#include <cstddef>
+#include <log/message_types.h>
+#include <log/message_initializer.h>
+
+namespace isc {
+namespace log {
+
+extern const isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG = "LOGIMPL_ABOVE_MAX_DEBUG";
+extern const isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING = "LOGIMPL_BAD_DEBUG_STRING";
+extern const isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG = "LOGIMPL_BELOW_MIN_DEBUG";
+
+} // namespace log
+} // namespace isc
+
+namespace {
+
+const char* values[] = {
+    "LOGIMPL_ABOVE_MAX_DEBUG", "debug level of %1 is too high and will be set to the maximum of %2",
+    "LOGIMPL_BAD_DEBUG_STRING", "debug string '%1' has invalid format",
+    "LOGIMPL_BELOW_MIN_DEBUG", "debug level of %1 is too low and will be set to the minimum of %2",
+    NULL
+};
+
+const isc::log::MessageInitializer initializer(values);
+
+} // Anonymous namespace
+
diff --git a/src/lib/log/logimpl_messages.h b/src/lib/log/logimpl_messages.h
new file mode 100644
index 0000000..1b94838
--- /dev/null
+++ b/src/lib/log/logimpl_messages.h
@@ -0,0 +1,18 @@
+// File created from logimpl_messages.mes on Wed Jun 22 10:57:02 2011
+
+#ifndef __LOGIMPL_MESSAGES_H
+#define __LOGIMPL_MESSAGES_H
+
+#include <log/message_types.h>
+
+namespace isc {
+namespace log {
+
+extern const isc::log::MessageID LOGIMPL_ABOVE_MAX_DEBUG;
+extern const isc::log::MessageID LOGIMPL_BAD_DEBUG_STRING;
+extern const isc::log::MessageID LOGIMPL_BELOW_MIN_DEBUG;
+
+} // namespace log
+} // namespace isc
+
+#endif // __LOGIMPL_MESSAGES_H
diff --git a/src/lib/log/logimpl_messages.mes b/src/lib/log/logimpl_messages.mes
new file mode 100644
index 0000000..c40f80c
--- /dev/null
+++ b/src/lib/log/logimpl_messages.mes
@@ -0,0 +1,43 @@
+# Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+# PERFORMANCE OF THIS SOFTWARE.
+
+# \brief Logger Implementation Messages
+#
+# This holds messages generated by the underlying logger implementation.  They
+# are likely to be specific to that implementation, and may well change if the
+# underlying implementation is changed.  For that reason, they have been put
+# in a separate file.
+
+$NAMESPACE isc::log
+
+% LOGIMPL_ABOVE_MAX_DEBUG debug level of %1 is too high and will be set to the maximum of %2
+A message from the interface to the underlying logger implementation reporting
+that the debug level (as set by an internally-created string DEBUGn, where n
+is an integer, e.g. DEBUG22) is above the maximum allowed value and has
+been reduced to that value.  The appearance of this message may indicate
+a programming error - please submit a bug report.
+
+% LOGIMPL_BAD_DEBUG_STRING debug string '%1' has invalid format
+A message from the interface to the underlying logger implementation
+reporting that an internally-created string used to set the debug level
+is not of the correct format (it should be of the form DEBUGn, where n
+is an integer, e.g. DEBUG22).  The appearance of this message indicates
+a programming error - please submit a bug report.
+
+% LOGIMPL_BELOW_MIN_DEBUG debug level of %1 is too low and will be set to the minimum of %2
+A message from the interface to the underlying logger implementation reporting
+that the debug level (as set by an internally-created string DEBUGn, where n
+is an integer, e.g. DEBUG22) is below the minimum allowed value and has
+been increased to that value.  The appearance of this message may indicate
+a programming error - please submit a bug report.
diff --git a/src/lib/log/message_reader.cc b/src/lib/log/message_reader.cc
index 1a0b242..2710ab8 100644
--- a/src/lib/log/message_reader.cc
+++ b/src/lib/log/message_reader.cc
@@ -20,8 +20,8 @@
 #include <iostream>
 #include <fstream>
 
+#include <log/log_messages.h>
 #include <log/message_exception.h>
-#include <log/messagedef.h>
 #include <log/message_reader.h>
 #include <util/strutil.h>
 
@@ -48,7 +48,7 @@ MessageReader::readFile(const string& file, MessageReader::Mode mode) {
     // Open the file.
     ifstream infile(file.c_str());
     if (infile.fail()) {
-        throw MessageException(MSG_OPENIN, file, strerror(errno));
+        throw MessageException(LOG_INPUT_OPEN_FAIL, file, strerror(errno));
     }
 
     // Loop round reading it.  As we process the file one line at a time,
@@ -65,7 +65,7 @@ MessageReader::readFile(const string& file, MessageReader::Mode mode) {
 
     // Why did the loop terminate?
     if (!infile.eof()) {
-        throw MessageException(MSG_READERR, file, strerror(errno));
+        throw MessageException(LOG_READ_ERROR, file, strerror(errno));
     }
     infile.close();
 }
@@ -114,7 +114,7 @@ MessageReader::parseDirective(const std::string& text) {
     } else {
 
         // Unrecognised directive
-        throw MessageException(MSG_UNRECDIR, tokens[0], lineno_);
+        throw MessageException(LOG_UNRECOGNISED_DIRECTIVE, tokens[0], lineno_);
     }
 }
 
@@ -138,13 +138,13 @@ MessageReader::parsePrefix(const vector<string>& tokens) {
         // and numeric characters (and underscores) and does not start with a
         // digit.
         if (invalidSymbol(prefix_)) {
-            throw MessageException(MSG_PRFINVARG, prefix_, lineno_);
+            throw MessageException(LOG_PREFIX_INVALID_ARG, prefix_, lineno_);
         }
 
     } else {
 
         // Too many arguments
-        throw MessageException(MSG_PRFEXTRARG, lineno_);
+        throw MessageException(LOG_PREFIX_EXTRA_ARGS, lineno_);
     }
 }
 
@@ -172,10 +172,10 @@ MessageReader::parseNamespace(const vector<string>& tokens) {
 
     // Check argument count
     if (tokens.size() < 2) {
-        throw MessageException(MSG_NSNOARG, lineno_);
+        throw MessageException(LOG_NAMESPACE_NO_ARGS, lineno_);
 
     } else if (tokens.size() > 2) {
-        throw MessageException(MSG_NSEXTRARG, lineno_);
+        throw MessageException(LOG_NAMESPACE_EXTRA_ARGS, lineno_);
 
     }
 
@@ -187,12 +187,12 @@ MessageReader::parseNamespace(const vector<string>& tokens) {
                                       "abcdefghijklmnopqrstuvwxyz"
                                       "0123456789_:";
     if (tokens[1].find_first_not_of(valid_chars) != string::npos) {
-        throw MessageException(MSG_NSINVARG, tokens[1], lineno_);
+        throw MessageException(LOG_NAMESPACE_INVALID_ARG, tokens[1], lineno_);
     }
 
     // All OK - unless the namespace has already been set.
     if (ns_.size() != 0) {
-        throw MessageException(MSG_DUPLNS, lineno_);
+        throw MessageException(LOG_DUPLICATE_NAMESPACE, lineno_);
     }
 
     // Prefix has not been set, so set it and return success.
@@ -219,7 +219,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
 
     // A line comprising just the message introducer is not valid.
     if (text.size() == 1) {
-        throw MessageException(MSG_NOMSGID, text, lineno_);
+        throw MessageException(LOG_NO_MESSAGE_ID, text, lineno_);
     }
 
     // Strip off the introducer and any leading space after that.
@@ -230,7 +230,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
     if (first_delim == string::npos) {
 
         // Just a single token in the line - this is not valid
-        throw MessageException(MSG_NOMSGTXT, message_line, lineno_);
+        throw MessageException(LOG_NO_MESSAGE_TEXT, message_line, lineno_);
     }
 
     // Extract the first token into the message ID, preceding it with the
@@ -240,7 +240,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
     string ident = prefix_ + message_line.substr(0, first_delim);
     if (prefix_.empty()) {
         if (invalidSymbol(ident)) {
-            throw MessageException(MSG_INVMSGID, ident, lineno_);
+            throw MessageException(LOG_INVALID_MESSAGE_ID, ident, lineno_);
         }
     }
     isc::util::str::uppercase(ident);
@@ -252,7 +252,7 @@ MessageReader::parseMessage(const std::string& text, MessageReader::Mode mode) {
         // ?? This happens if there are trailing delimiters, which should not
         // occur as we have stripped trailing spaces off the line.  Just treat
         // this as a single-token error for simplicity's sake.
-        throw MessageException(MSG_NOMSGTXT, message_line, lineno_);
+        throw MessageException(LOG_NO_MESSAGE_TEXT, message_line, lineno_);
     }
 
     // Add the result to the dictionary and to the non-added list if the add to
diff --git a/src/lib/log/messagedef.cc b/src/lib/log/messagedef.cc
deleted file mode 100644
index 853722a..0000000
--- a/src/lib/log/messagedef.cc
+++ /dev/null
@@ -1,63 +0,0 @@
-// File created from messagedef.mes on Fri May 27 14:49:45 2011
-
-#include <cstddef>
-#include <log/message_types.h>
-#include <log/message_initializer.h>
-
-namespace isc {
-namespace log {
-
-extern const isc::log::MessageID MSG_BADDESTINATION = "MSG_BADDESTINATION";
-extern const isc::log::MessageID MSG_BADSEVERITY = "MSG_BADSEVERITY";
-extern const isc::log::MessageID MSG_BADSTREAM = "MSG_BADSTREAM";
-extern const isc::log::MessageID MSG_DUPLNS = "MSG_DUPLNS";
-extern const isc::log::MessageID MSG_DUPMSGID = "MSG_DUPMSGID";
-extern const isc::log::MessageID MSG_IDNOTFND = "MSG_IDNOTFND";
-extern const isc::log::MessageID MSG_INVMSGID = "MSG_INVMSGID";
-extern const isc::log::MessageID MSG_NOMSGID = "MSG_NOMSGID";
-extern const isc::log::MessageID MSG_NOMSGTXT = "MSG_NOMSGTXT";
-extern const isc::log::MessageID MSG_NSEXTRARG = "MSG_NSEXTRARG";
-extern const isc::log::MessageID MSG_NSINVARG = "MSG_NSINVARG";
-extern const isc::log::MessageID MSG_NSNOARG = "MSG_NSNOARG";
-extern const isc::log::MessageID MSG_OPENIN = "MSG_OPENIN";
-extern const isc::log::MessageID MSG_OPENOUT = "MSG_OPENOUT";
-extern const isc::log::MessageID MSG_PRFEXTRARG = "MSG_PRFEXTRARG";
-extern const isc::log::MessageID MSG_PRFINVARG = "MSG_PRFINVARG";
-extern const isc::log::MessageID MSG_RDLOCMES = "MSG_RDLOCMES";
-extern const isc::log::MessageID MSG_READERR = "MSG_READERR";
-extern const isc::log::MessageID MSG_UNRECDIR = "MSG_UNRECDIR";
-extern const isc::log::MessageID MSG_WRITERR = "MSG_WRITERR";
-
-} // namespace log
-} // namespace isc
-
-namespace {
-
-const char* values[] = {
-    "MSG_BADDESTINATION", "unrecognized log destination: %1",
-    "MSG_BADSEVERITY", "unrecognized log severity: %1",
-    "MSG_BADSTREAM", "bad log console output stream: %1",
-    "MSG_DUPLNS", "line %1: duplicate $NAMESPACE directive found",
-    "MSG_DUPMSGID", "duplicate message ID (%1) in compiled code",
-    "MSG_IDNOTFND", "could not replace message text for '%1': no such message",
-    "MSG_INVMSGID", "line %1: invalid message identification '%2'",
-    "MSG_NOMSGID", "line %1: message definition line found without a message ID",
-    "MSG_NOMSGTXT", "line %1: line found containing a message ID ('%2') and no text",
-    "MSG_NSEXTRARG", "line %1: $NAMESPACE directive has too many arguments",
-    "MSG_NSINVARG", "line %1: $NAMESPACE directive has an invalid argument ('%2')",
-    "MSG_NSNOARG", "line %1: no arguments were given to the $NAMESPACE directive",
-    "MSG_OPENIN", "unable to open message file %1 for input: %2",
-    "MSG_OPENOUT", "unable to open %1 for output: %2",
-    "MSG_PRFEXTRARG", "line %1: $PREFIX directive has too many arguments",
-    "MSG_PRFINVARG", "line %1: $PREFIX directive has an invalid argument ('%2')",
-    "MSG_RDLOCMES", "reading local message file %1",
-    "MSG_READERR", "error reading from message file %1: %2",
-    "MSG_UNRECDIR", "line %1: unrecognised directive '%2'",
-    "MSG_WRITERR", "error writing to %1: %2",
-    NULL
-};
-
-const isc::log::MessageInitializer initializer(values);
-
-} // Anonymous namespace
-
diff --git a/src/lib/log/messagedef.h b/src/lib/log/messagedef.h
deleted file mode 100644
index bdb1075..0000000
--- a/src/lib/log/messagedef.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// File created from messagedef.mes on Fri May 27 14:49:45 2011
-
-#ifndef __MESSAGEDEF_H
-#define __MESSAGEDEF_H
-
-#include <log/message_types.h>
-
-namespace isc {
-namespace log {
-
-extern const isc::log::MessageID MSG_BADDESTINATION;
-extern const isc::log::MessageID MSG_BADSEVERITY;
-extern const isc::log::MessageID MSG_BADSTREAM;
-extern const isc::log::MessageID MSG_DUPLNS;
-extern const isc::log::MessageID MSG_DUPMSGID;
-extern const isc::log::MessageID MSG_IDNOTFND;
-extern const isc::log::MessageID MSG_INVMSGID;
-extern const isc::log::MessageID MSG_NOMSGID;
-extern const isc::log::MessageID MSG_NOMSGTXT;
-extern const isc::log::MessageID MSG_NSEXTRARG;
-extern const isc::log::MessageID MSG_NSINVARG;
-extern const isc::log::MessageID MSG_NSNOARG;
-extern const isc::log::MessageID MSG_OPENIN;
-extern const isc::log::MessageID MSG_OPENOUT;
-extern const isc::log::MessageID MSG_PRFEXTRARG;
-extern const isc::log::MessageID MSG_PRFINVARG;
-extern const isc::log::MessageID MSG_RDLOCMES;
-extern const isc::log::MessageID MSG_READERR;
-extern const isc::log::MessageID MSG_UNRECDIR;
-extern const isc::log::MessageID MSG_WRITERR;
-
-} // namespace log
-} // namespace isc
-
-#endif // __MESSAGEDEF_H
diff --git a/src/lib/log/messagedef.mes b/src/lib/log/messagedef.mes
deleted file mode 100644
index a54931b..0000000
--- a/src/lib/log/messagedef.mes
+++ /dev/null
@@ -1,131 +0,0 @@
-# Copyright (C) 2011  Internet Systems Consortium, Inc. ("ISC")
-#
-# Permission to use, copy, modify, and/or distribute this software for any
-# purpose with or without fee is hereby granted, provided that the above
-# copyright notice and this permission notice appear in all copies.
-#
-# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
-# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
-# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
-# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-# PERFORMANCE OF THIS SOFTWARE.
-
-# \brief Message Utility Message File
-#
-# This is the source of the set of messages generated by the message and
-# logging components.  The associated .h and .cc files are created by hand from
-# this file though and are not built during the build process; this is to avoid
-# the chicken-and-egg situation where we need the files to build the message
-# compiler, yet we need the compiler to build the files.
-
-$PREFIX MSG_
-$NAMESPACE isc::log
-
-% DUPMSGID      duplicate message ID (%1) in compiled code
-Indicative of a programming error, when it started up, BIND10 detected that
-the given message ID had been registered by one or more modules.  (All message
-IDs should be unique throughout BIND10.)  This has no impact on the operation
-of the server other that erroneous messages may be logged.  (When BIND10 loads
-the message IDs (and their associated text), if a duplicate ID is found it is
-discarded.  However, when the module that supplied the duplicate ID logs that
-particular message, the text supplied by the module that added the original
-ID will be output - something that may bear no relation to the condition being
-logged.
-
-% DUPLNS        line %1: duplicate $NAMESPACE directive found
-When reading a message file, more than one $NAMESPACE directive was found.  In
-this version of the code, such a condition is regarded as an error and the
-read will be abandoned.
-
-% IDNOTFND      could not replace message text for '%1': no such message
-During start-up a local message file was read.  A line with the listed
-message identification was found in the file, but the identification is not
-one contained in the compiled-in message dictionary.  Either the message
-identification has been mis-spelled in the file, or the local file was used
-for an earlier version of the software and the message with that
-identification has been removed.
-
-This message may appear a number of times in the file, once for every such
-unknown message identification.
-
-% INVMSGID      line %1: invalid message identification '%2'
-The concatenation of the prefix and the message identification is used as
-a symbol in the C++ module; as such it may only contain 
-
-% NOMSGID       line %1: message definition line found without a message ID
-Message definition lines are lines starting with a "%".  The rest of the line
-should comprise the message ID and text describing the message.  This error
-indicates the message compiler found a line in the message file comprising
-just the "%" and nothing else.
-
-% NOMSGTXT      line %1: line found containing a message ID ('%2') and no text
-Message definition lines are lines starting with a "%".  The rest of the line
-should comprise the message ID and text describing the message.  This error
-is generated when a line is found in the message file that contains the
-leading "%" and the message identification but no text.
-
-% NSEXTRARG     line %1: $NAMESPACE directive has too many arguments
-The $NAMESPACE directive takes a single argument, a namespace in which all the
-generated symbol names are placed.  This error is generated when the
-compiler finds a $NAMESPACE directive with more than one argument.
-
-% NSINVARG      line %1: $NAMESPACE directive has an invalid argument ('%2')
-The $NAMESPACE argument should be a valid C++ namespace.  The reader does a
-cursory check on its validity, checking that the characters in the namespace
-are correct.  The error is generated when the reader finds an invalid
-character. (Valid are alphanumeric characters, underscores and colons.)
-
-% NSNOARG       line %1: no arguments were given to the $NAMESPACE directive
-The $NAMESPACE directive takes a single argument, a namespace in which all the
-generated symbol names are placed.  This error is generated when the
-compiler finds a $NAMESPACE directive with no arguments.
-
-% OPENIN        unable to open message file %1 for input: %2
-The program was not able to open the specified input message file for the
-reason given.
-
-% OPENOUT       unable to open %1 for output: %2
-The program was not able to open the specified output file for the reason
-given.
-
-% PRFEXTRARG    line %1: $PREFIX directive has too many arguments
-The $PREFIX directive takes a single argument, a prefix to be added to the
-symbol names when a C++ .h file is created.  This error is generated when the
-compiler finds a $PREFIX directive with more than one argument.
-
-% PRFINVARG     line %1: $PREFIX directive has an invalid argument ('%2')
-The $PREFIX argument is used in a symbol name in a C++ header file.  As such,
-it must adhere to restrictions on C++ symbol names (e.g. may only contain
-alphanumeric characters or underscores, and may nor start with a digit).
-A $PREFIX directive was found with an argument (given in the message) that
-violates those restictions.
-
-% RDLOCMES      reading local message file %1
-This is an informational message output by BIND10 when it starts to read a
-local message file.  (A local message file may replace the text of one of more
-messages; the ID of the message will not be changed though.)
-
-% READERR       error reading from message file %1: %2
-The specified error was encountered reading from the named message file.
-
-% WRITERR       error writing to %1: %2
-The specified error was encountered by the message compiler when writing to
-the named output file.
-
-% UNRECDIR      line %1: unrecognised directive '%2'
-A line starting with a dollar symbol was found, but the first word on the line
-(shown in the message) was not a recognised message compiler directive.
-
-% BADSEVERITY   unrecognized log severity: %1
-A logger severity value was given that was not recognized. The severity
-should be one of "DEBUG", "INFO", "WARN", "ERROR", or "FATAL".
-
-% BADDESTINATION unrecognized log destination: %1
-A logger destination value was given that was not recognized. The
-destination should be one of "console", "file", or "syslog".
-
-% BADSTREAM     bad log console output stream: %1
-A log console output stream was given that was not recognized. The
-output stream should be one of "stdout", or "stderr"
diff --git a/src/lib/log/output_option.cc b/src/lib/log/output_option.cc
index 191631d..f56efb9 100644
--- a/src/lib/log/output_option.cc
+++ b/src/lib/log/output_option.cc
@@ -13,12 +13,13 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include <string>
-#include <log/output_option.h>
-#include <log/macros.h>
-#include <log/messagedef.h>
 
 #include <boost/algorithm/string.hpp>
 
+#include <log/log_messages.h>
+#include <log/macros.h>
+#include <log/output_option.h>
+
 namespace isc {
 namespace log {
 
@@ -32,7 +33,7 @@ getDestination(const std::string& dest_str) {
         return OutputOption::DEST_SYSLOG;
     } else {
         Logger logger("log");
-        LOG_ERROR(logger, MSG_BADDESTINATION).arg(dest_str);
+        LOG_ERROR(logger, LOG_BAD_DESTINATION).arg(dest_str);
         return OutputOption::DEST_CONSOLE;
     }
 }
@@ -45,7 +46,7 @@ getStream(const std::string& stream_str) {
         return OutputOption::STR_STDOUT;
     } else {
         Logger logger("log");
-        LOG_ERROR(logger, MSG_BADSTREAM).arg(stream_str);
+        LOG_ERROR(logger, LOG_BAD_STREAM).arg(stream_str);
         return OutputOption::STR_STDOUT;
     }
 }
diff --git a/src/lib/log/tests/destination_test.sh.in b/src/lib/log/tests/destination_test.sh.in
index e02141d..41a52ee 100755
--- a/src/lib/log/tests/destination_test.sh.in
+++ b/src/lib/log/tests/destination_test.sh.in
@@ -37,10 +37,10 @@ passfail() {
 
 echo "1. One logger, multiple destinations:"
 cat > $tempfile << .
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
 .
 rm -f $destfile1 $destfile2
 ./logger_example -s error -f $destfile1 -f $destfile2
@@ -61,13 +61,13 @@ rm -f $destfile1 $destfile2
 # Output for example.alpha should have done to destfile2.
 
 cat > $tempfile << .
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-WARN  [example] MSG_BADSTREAM bad log console output stream: example
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
-WARN  [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
-INFO  [example.beta] MSG_READERR error reading from message file beta: info
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+WARN  [example] LOG_BAD_STREAM bad log console output stream: example
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
+WARN  [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
+INFO  [example.beta] LOG_READ_ERROR error reading from message file beta: info
 .
 echo -n  "   - destination 1:"
 cut -d' ' -f3- $destfile1 | diff $tempfile -
@@ -75,7 +75,7 @@ passfail $?
 
 echo -n  "   - destination 2:"
 cat > $tempfile << .
-WARN  [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
+WARN  [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
 .
 cut -d' ' -f3- $destfile2 | diff $tempfile -
 passfail $?
diff --git a/src/lib/log/tests/local_file_test.sh.in b/src/lib/log/tests/local_file_test.sh.in
index 4308f96..d76f48f 100755
--- a/src/lib/log/tests/local_file_test.sh.in
+++ b/src/lib/log/tests/local_file_test.sh.in
@@ -37,35 +37,35 @@ passfail() {
 # Create the local message file for testing
 
 cat > $localmes << .
-% MSG_NOTHERE     this message is not in the global dictionary
-% MSG_READERR     replacement read error, parameters: '%1' and '%2'
-% MSG_RDLOCMES    replacement read local message file, parameter is '%1'
+% LOG_NOTHERE this message is not in the global dictionary
+% LOG_READ_ERROR replacement read error, parameters: '%1' and '%2'
+% LOG_READING_LOCAL_FILE replacement read local message file, parameter is '%1'
 .
 
 echo -n "1. Local message replacement:"
 cat > $tempfile << .
-WARN  [example.log] MSG_IDNOTFND could not replace message text for 'MSG_NOTHERE': no such message
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES replacement read local message file, parameter is 'dummy/file'
-WARN  [example] MSG_BADSTREAM bad log console output stream: example
-WARN  [example.alpha] MSG_READERR replacement read error, parameters: 'a.txt' and 'dummy reason'
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
-WARN  [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
+WARN  [example.log] LOG_NO_SUCH_MESSAGE could not replace message text for 'LOG_NOTHERE': no such message
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE replacement read local message file, parameter is 'dummy/file'
+WARN  [example] LOG_BAD_STREAM bad log console output stream: example
+WARN  [example.alpha] LOG_READ_ERROR replacement read error, parameters: 'a.txt' and 'dummy reason'
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
+WARN  [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
 .
 ./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
 passfail $?
 
 echo -n "2. Report error if unable to read local message file:"
 cat > $tempfile << .
-ERROR [example.log] MSG_OPENIN unable to open message file $localmes for input: No such file or directory
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-WARN  [example] MSG_BADSTREAM bad log console output stream: example
-WARN  [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
-WARN  [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
+ERROR [example.log] LOG_INPUT_OPEN_FAIL unable to open message file $localmes for input: No such file or directory
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+WARN  [example] LOG_BAD_STREAM bad log console output stream: example
+WARN  [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
+WARN  [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
 .
 rm -f $localmes
 ./logger_example -c stdout -s warn $localmes | cut -d' ' -f3- | diff $tempfile -
diff --git a/src/lib/log/tests/logger_example.cc b/src/lib/log/tests/logger_example.cc
index 6b43c18..2170066 100644
--- a/src/lib/log/tests/logger_example.cc
+++ b/src/lib/log/tests/logger_example.cc
@@ -40,7 +40,7 @@
 #include <log/macros.h>
 
 // Include a set of message definitions.
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 
 using namespace isc::log;
 using namespace std;
@@ -285,21 +285,21 @@ int main(int argc, char** argv) {
     isc::log::Logger logger_alpha("alpha");
     isc::log::Logger logger_beta("beta");
 
-    LOG_FATAL(logger_ex, MSG_WRITERR).arg("test1").arg("42");
-    LOG_ERROR(logger_ex, MSG_RDLOCMES).arg("dummy/file");
-    LOG_WARN(logger_ex, MSG_BADSTREAM).arg("example");
-    LOG_WARN(logger_alpha, MSG_READERR).arg("a.txt").arg("dummy reason");
-    LOG_INFO(logger_alpha, MSG_OPENIN).arg("example.msg").arg("dummy reason");
-    LOG_DEBUG(logger_ex, 0, MSG_RDLOCMES).arg("example/0");
-    LOG_DEBUG(logger_ex, 24, MSG_RDLOCMES).arg("example/24");
-    LOG_DEBUG(logger_ex, 25, MSG_RDLOCMES).arg("example/25");
-    LOG_DEBUG(logger_ex, 26, MSG_RDLOCMES).arg("example/26");
-    LOG_FATAL(logger_beta, MSG_BADSEVERITY).arg("beta_fatal");
-    LOG_ERROR(logger_beta, MSG_BADDESTINATION).arg("beta_error");
-    LOG_WARN(logger_beta, MSG_BADSTREAM).arg("beta_warn");
-    LOG_INFO(logger_beta, MSG_READERR).arg("beta").arg("info");
-    LOG_DEBUG(logger_beta, 25, MSG_BADSEVERITY).arg("beta/25");
-    LOG_DEBUG(logger_beta, 26, MSG_BADSEVERITY).arg("beta/26");
+    LOG_FATAL(logger_ex, LOG_WRITE_ERROR).arg("test1").arg("42");
+    LOG_ERROR(logger_ex, LOG_READING_LOCAL_FILE).arg("dummy/file");
+    LOG_WARN(logger_ex, LOG_BAD_STREAM).arg("example");
+    LOG_WARN(logger_alpha, LOG_READ_ERROR).arg("a.txt").arg("dummy reason");
+    LOG_INFO(logger_alpha, LOG_INPUT_OPEN_FAIL).arg("example.msg").arg("dummy reason");
+    LOG_DEBUG(logger_ex, 0, LOG_READING_LOCAL_FILE).arg("example/0");
+    LOG_DEBUG(logger_ex, 24, LOG_READING_LOCAL_FILE).arg("example/24");
+    LOG_DEBUG(logger_ex, 25, LOG_READING_LOCAL_FILE).arg("example/25");
+    LOG_DEBUG(logger_ex, 26, LOG_READING_LOCAL_FILE).arg("example/26");
+    LOG_FATAL(logger_beta, LOG_BAD_SEVERITY).arg("beta_fatal");
+    LOG_ERROR(logger_beta, LOG_BAD_DESTINATION).arg("beta_error");
+    LOG_WARN(logger_beta, LOG_BAD_STREAM).arg("beta_warn");
+    LOG_INFO(logger_beta, LOG_READ_ERROR).arg("beta").arg("info");
+    LOG_DEBUG(logger_beta, 25, LOG_BAD_SEVERITY).arg("beta/25");
+    LOG_DEBUG(logger_beta, 26, LOG_BAD_SEVERITY).arg("beta/26");
 
     return (0);
 }
diff --git a/src/lib/log/tests/logger_level_unittest.cc b/src/lib/log/tests/logger_level_unittest.cc
index 13d33b2..8c98091 100644
--- a/src/lib/log/tests/logger_level_unittest.cc
+++ b/src/lib/log/tests/logger_level_unittest.cc
@@ -19,8 +19,8 @@
 
 #include <log/logger.h>
 #include <log/logger_manager.h>
+#include <log/log_messages.h>
 #include <log/logger_name.h>
-#include <log/messagedef.h>
 
 using namespace isc;
 using namespace isc::log;
diff --git a/src/lib/log/tests/logger_manager_unittest.cc b/src/lib/log/tests/logger_manager_unittest.cc
index 115c928..0bdfc74 100644
--- a/src/lib/log/tests/logger_manager_unittest.cc
+++ b/src/lib/log/tests/logger_manager_unittest.cc
@@ -27,7 +27,7 @@
 #include <exceptions/exceptions.h>
 
 #include <log/macros.h>
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 #include <log/logger.h>
 #include <log/logger_level.h>
 #include <log/logger_manager.h>
@@ -203,16 +203,16 @@ TEST_F(LoggerManagerTest, FileLogger) {
         // keep the file open.
         Logger logger(file_spec.getLoggerName());
 
-        LOG_FATAL(logger, MSG_DUPMSGID).arg("test");
-        ids.push_back(MSG_DUPMSGID);
+        LOG_FATAL(logger, LOG_DUPLICATE_MESSAGE_ID).arg("test");
+        ids.push_back(LOG_DUPLICATE_MESSAGE_ID);
 
-        LOG_FATAL(logger, MSG_DUPLNS).arg("test");
-        ids.push_back(MSG_DUPLNS);
+        LOG_FATAL(logger, LOG_DUPLICATE_NAMESPACE).arg("test");
+        ids.push_back(LOG_DUPLICATE_NAMESPACE);
     }
     LoggerManager::reset();
 
     // At this point, the output file should contain two lines with messages
-    // MSG_DUPMSGID and MSG_DUPLNS messages - test this.
+    // LOG_DUPLICATE_MESSAGE_ID and LOG_DUPLICATE_NAMESPACE messages - test this.
     checkFileContents(file_spec.getFileName(), ids.begin(), ids.end());
 
     // Re-open the file (we have to assume that it was closed when we
@@ -225,14 +225,14 @@ TEST_F(LoggerManagerTest, FileLogger) {
     // Create a new instance of the logger and log three more messages.
     Logger logger(file_spec.getLoggerName());
 
-    LOG_FATAL(logger, MSG_IDNOTFND).arg("test");
-    ids.push_back(MSG_IDNOTFND);
+    LOG_FATAL(logger, LOG_NO_SUCH_MESSAGE).arg("test");
+    ids.push_back(LOG_NO_SUCH_MESSAGE);
 
-    LOG_FATAL(logger, MSG_INVMSGID).arg("test").arg("test2");
-    ids.push_back(MSG_INVMSGID);
+    LOG_FATAL(logger, LOG_INVALID_MESSAGE_ID).arg("test").arg("test2");
+    ids.push_back(LOG_INVALID_MESSAGE_ID);
 
-    LOG_FATAL(logger, MSG_NOMSGID).arg("42");
-    ids.push_back(MSG_NOMSGID);
+    LOG_FATAL(logger, LOG_NO_MESSAGE_ID).arg("42");
+    ids.push_back(LOG_NO_MESSAGE_ID);
 
     // Close the file and check again
     LoggerManager::reset();
@@ -276,19 +276,19 @@ TEST_F(LoggerManagerTest, FileSizeRollover) {
     // be rolled after the message is logged.
     {
         Logger logger(file_spec.getLoggerName());
-        LOG_FATAL(logger, MSG_IDNOTFND).arg(big_arg);
-        LOG_FATAL(logger, MSG_DUPLNS).arg(big_arg);
+        LOG_FATAL(logger, LOG_NO_SUCH_MESSAGE).arg(big_arg);
+        LOG_FATAL(logger, LOG_DUPLICATE_NAMESPACE).arg(big_arg);
     }
 
     // Check them.
     LoggerManager::reset();     // Ensure files are closed
 
     vector<MessageID> ids;
-    ids.push_back(MSG_IDNOTFND);
+    ids.push_back(LOG_NO_SUCH_MESSAGE);
     checkFileContents(prev_name[1], ids.begin(), ids.end());
 
     ids.clear();
-    ids.push_back(MSG_DUPLNS);
+    ids.push_back(LOG_DUPLICATE_NAMESPACE);
     checkFileContents(prev_name[0], ids.begin(), ids.end());
 
     // Log another message and check that the files have rotated and that
@@ -296,18 +296,18 @@ TEST_F(LoggerManagerTest, FileSizeRollover) {
     manager.process(spec);
     {
         Logger logger(file_spec.getLoggerName());
-        LOG_FATAL(logger, MSG_NOMSGTXT).arg(big_arg);
+        LOG_FATAL(logger, LOG_NO_MESSAGE_TEXT).arg(big_arg);
     }
 
     LoggerManager::reset();     // Ensure files are closed
 
     // Check that the files have moved.
     ids.clear();
-    ids.push_back(MSG_DUPLNS);
+    ids.push_back(LOG_DUPLICATE_NAMESPACE);
     checkFileContents(prev_name[1], ids.begin(), ids.end());
 
     ids.clear();
-    ids.push_back(MSG_NOMSGTXT);
+    ids.push_back(LOG_NO_MESSAGE_TEXT);
     checkFileContents(prev_name[0], ids.begin(), ids.end());
 
     // ... and check that the .3 version does not exist.
diff --git a/src/lib/log/tests/logger_support_unittest.cc b/src/lib/log/tests/logger_support_unittest.cc
index 7e5d23a..6a93652 100644
--- a/src/lib/log/tests/logger_support_unittest.cc
+++ b/src/lib/log/tests/logger_support_unittest.cc
@@ -14,7 +14,7 @@
 
 #include <gtest/gtest.h>
 #include <log/logger_support.h>
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 
 using namespace isc::log;
 
@@ -63,10 +63,10 @@ TEST(LoggerSupportTest, LoggingInitializationCheck) {
     isc::log::Logger test_logger("test");
 
     EXPECT_THROW(test_logger.isDebugEnabled(), LoggingNotInitialized);
-    EXPECT_THROW(test_logger.info(MSG_OPENIN), LoggingNotInitialized);
+    EXPECT_THROW(test_logger.info(LOG_INPUT_OPEN_FAIL), LoggingNotInitialized);
 
     // ... and check that they work when logging is initialized.
     setLoggingInitialized(true);
     EXPECT_NO_THROW(test_logger.isDebugEnabled());
-    EXPECT_NO_THROW(test_logger.info(MSG_OPENIN));
+    EXPECT_NO_THROW(test_logger.info(LOG_INPUT_OPEN_FAIL));
 }
diff --git a/src/lib/log/tests/logger_unittest.cc b/src/lib/log/tests/logger_unittest.cc
index b7858e5..edca9ce 100644
--- a/src/lib/log/tests/logger_unittest.cc
+++ b/src/lib/log/tests/logger_unittest.cc
@@ -20,7 +20,7 @@
 #include <log/logger.h>
 #include <log/logger_manager.h>
 #include <log/logger_name.h>
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 
 using namespace isc;
 using namespace isc::log;
diff --git a/src/lib/log/tests/message_dictionary_unittest.cc b/src/lib/log/tests/message_dictionary_unittest.cc
index ba33820..394fea0 100644
--- a/src/lib/log/tests/message_dictionary_unittest.cc
+++ b/src/lib/log/tests/message_dictionary_unittest.cc
@@ -29,7 +29,7 @@ using namespace std;
 // and the latter should be present.
 
 static const char* values[] = {
-    "MSG_DUPLNS", "duplicate $NAMESPACE directive found",
+    "LOG_DUPLICATE_NAMESPACE", "duplicate $NAMESPACE directive found",
     "NEWSYM", "new symbol added",
     NULL
 };
@@ -190,7 +190,7 @@ TEST_F(MessageDictionaryTest, GlobalTest) {
 TEST_F(MessageDictionaryTest, GlobalLoadTest) {
     vector<string>& duplicates = MessageInitializer::getDuplicates();
     ASSERT_EQ(1, duplicates.size());
-    EXPECT_EQ(string("MSG_DUPLNS"), duplicates[0]);
+    EXPECT_EQ(string("LOG_DUPLICATE_NAMESPACE"), duplicates[0]);
 
     string text = MessageDictionary::globalDictionary().getText("NEWSYM");
     EXPECT_EQ(string("new symbol added"), text);
diff --git a/src/lib/log/tests/message_reader_unittest.cc b/src/lib/log/tests/message_reader_unittest.cc
index 7b3ba5f..d0214a4 100644
--- a/src/lib/log/tests/message_reader_unittest.cc
+++ b/src/lib/log/tests/message_reader_unittest.cc
@@ -16,7 +16,7 @@
 #include <string>
 #include <gtest/gtest.h>
 
-#include <log/messagedef.h>
+#include <log/log_messages.h>
 #include <log/message_dictionary.h>
 #include <log/message_exception.h>
 #include <log/message_reader.h>
@@ -102,8 +102,8 @@ processLineException(MessageReader& reader, const char* what,
 TEST_F(MessageReaderTest, InvalidDirectives) {
 
     // Check that a "$" with nothing else generates an error
-    processLineException(reader_, "$", MSG_UNRECDIR);
-    processLineException(reader_, "$xyz", MSG_UNRECDIR);
+    processLineException(reader_, "$", LOG_UNRECOGNISED_DIRECTIVE);
+    processLineException(reader_, "$xyz", LOG_UNRECOGNISED_DIRECTIVE);
 }
 
 // Check that it can parse a prefix
@@ -117,20 +117,20 @@ TEST_F(MessageReaderTest, Prefix) {
     EXPECT_NO_THROW(reader_.processLine("$PREFIX"));
 
     // Check a $PREFIX with multiple arguments is invalid
-    processLineException(reader_, "$prefix A B", MSG_PRFEXTRARG);
+    processLineException(reader_, "$prefix A B", LOG_PREFIX_EXTRA_ARGS);
 
     // Prefixes should be alphanumeric (with underscores) and not start
     // with a number.
-    processLineException(reader_, "$prefix ab[cd", MSG_PRFINVARG);
-    processLineException(reader_, "$prefix 123", MSG_PRFINVARG);
-    processLineException(reader_, "$prefix 1ABC", MSG_PRFINVARG);
+    processLineException(reader_, "$prefix ab[cd", LOG_PREFIX_INVALID_ARG);
+    processLineException(reader_, "$prefix 123", LOG_PREFIX_INVALID_ARG);
+    processLineException(reader_, "$prefix 1ABC", LOG_PREFIX_INVALID_ARG);
 
     // A valid prefix should be accepted
     EXPECT_NO_THROW(reader_.processLine("$PREFIX   dlm__"));
     EXPECT_EQ(string("dlm__"), reader_.getPrefix());
 
     // And check that the parser fails on invalid prefixes...
-    processLineException(reader_, "$prefix 1ABC", MSG_PRFINVARG);
+    processLineException(reader_, "$prefix 1ABC", LOG_PREFIX_INVALID_ARG);
 
     // Check that we can clear the prefix as well
     reader_.clearPrefix();
@@ -150,13 +150,13 @@ TEST_F(MessageReaderTest, Namespace) {
     EXPECT_EQ(string(""), reader_.getNamespace());
 
     // Check that a $NAMESPACE directive with no argument generates an error.
-    processLineException(reader_, "$NAMESPACE", MSG_NSNOARG);
+    processLineException(reader_, "$NAMESPACE", LOG_NAMESPACE_NO_ARGS);
 
     // Check a $NAMESPACE with multiple arguments is invalid
-    processLineException(reader_, "$namespace A B", MSG_NSEXTRARG);
+    processLineException(reader_, "$namespace A B", LOG_NAMESPACE_EXTRA_ARGS);
 
     // Namespaces should be alphanumeric (with underscores and colons)
-    processLineException(reader_, "$namespace ab[cd", MSG_NSINVARG);
+    processLineException(reader_, "$namespace ab[cd", LOG_NAMESPACE_INVALID_ARG);
 
     // A valid $NAMESPACE should be accepted
     EXPECT_NO_THROW(reader_.processLine("$NAMESPACE isc"));
@@ -176,7 +176,7 @@ TEST_F(MessageReaderTest, Namespace) {
     EXPECT_EQ(string("::"), reader_.getNamespace());
 
     // ... and that another $NAMESPACE is rejected
-    processLineException(reader_, "$NAMESPACE ABC", MSG_DUPLNS);
+    processLineException(reader_, "$NAMESPACE ABC", LOG_DUPLICATE_NAMESPACE);
 }
 
 // Check that it can parse a line
diff --git a/src/lib/log/tests/severity_test.sh.in b/src/lib/log/tests/severity_test.sh.in
index 0a304e0..124f36a 100755
--- a/src/lib/log/tests/severity_test.sh.in
+++ b/src/lib/log/tests/severity_test.sh.in
@@ -35,44 +35,44 @@ passfail() {
 
 echo -n "1. runInitTest default parameters:"
 cat > $tempfile << .
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-WARN  [example] MSG_BADSTREAM bad log console output stream: example
-WARN  [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
-INFO  [example.alpha] MSG_OPENIN unable to open message file example.msg for input: dummy reason
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
-WARN  [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
-INFO  [example.beta] MSG_READERR error reading from message file beta: info
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+WARN  [example] LOG_BAD_STREAM bad log console output stream: example
+WARN  [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
+INFO  [example.alpha] LOG_INPUT_OPEN_FAIL unable to open message file example.msg for input: dummy reason
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
+WARN  [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
+INFO  [example.beta] LOG_READ_ERROR error reading from message file beta: info
 .
 ./logger_example -c stdout | cut -d' ' -f3- | diff $tempfile -
 passfail $?
 
 echo -n "2. Severity filter:"
 cat > $tempfile << .
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
 .
 ./logger_example -c stdout -s error | cut -d' ' -f3- | diff $tempfile -
 passfail $?
 
 echo -n "3. Debug level:"
 cat > $tempfile << .
-FATAL [example] MSG_WRITERR error writing to test1: 42
-ERROR [example] MSG_RDLOCMES reading local message file dummy/file
-WARN  [example] MSG_BADSTREAM bad log console output stream: example
-WARN  [example.alpha] MSG_READERR error reading from message file a.txt: dummy reason
-INFO  [example.alpha] MSG_OPENIN unable to open message file example.msg for input: dummy reason
-DEBUG [example] MSG_RDLOCMES reading local message file example/0
-DEBUG [example] MSG_RDLOCMES reading local message file example/24
-DEBUG [example] MSG_RDLOCMES reading local message file example/25
-FATAL [example.beta] MSG_BADSEVERITY unrecognized log severity: beta_fatal
-ERROR [example.beta] MSG_BADDESTINATION unrecognized log destination: beta_error
-WARN  [example.beta] MSG_BADSTREAM bad log console output stream: beta_warn
-INFO  [example.beta] MSG_READERR error reading from message file beta: info
-DEBUG [example.beta] MSG_BADSEVERITY unrecognized log severity: beta/25
+FATAL [example] LOG_WRITE_ERROR error writing to test1: 42
+ERROR [example] LOG_READING_LOCAL_FILE reading local message file dummy/file
+WARN  [example] LOG_BAD_STREAM bad log console output stream: example
+WARN  [example.alpha] LOG_READ_ERROR error reading from message file a.txt: dummy reason
+INFO  [example.alpha] LOG_INPUT_OPEN_FAIL unable to open message file example.msg for input: dummy reason
+DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/0
+DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/24
+DEBUG [example] LOG_READING_LOCAL_FILE reading local message file example/25
+FATAL [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta_fatal
+ERROR [example.beta] LOG_BAD_DESTINATION unrecognized log destination: beta_error
+WARN  [example.beta] LOG_BAD_STREAM bad log console output stream: beta_warn
+INFO  [example.beta] LOG_READ_ERROR error reading from message file beta: info
+DEBUG [example.beta] LOG_BAD_SEVERITY unrecognized log severity: beta/25
 .
 ./logger_example -c stdout -s debug -d 25 | cut -d' ' -f3- | diff $tempfile -
 passfail $?
diff --git a/src/lib/server_common/tests/Makefile.am b/src/lib/server_common/tests/Makefile.am
index af8c613..3c061c2 100644
--- a/src/lib/server_common/tests/Makefile.am
+++ b/src/lib/server_common/tests/Makefile.am
@@ -38,6 +38,8 @@ run_unittests_LDADD += $(top_builddir)/src/lib/server_common/libserver_common.la
 run_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libasiolink.la
 run_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libasiodns.la
 run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.la
+run_unittests_LDADD += $(top_builddir)/src/lib/acl/libacl.la
+run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
 run_unittests_LDADD += $(top_builddir)/src/lib/dns/libdns++.la
 run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
 run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la




More information about the bind10-changes mailing list