A simple {@link NumberCruncher} implementation that logs its
progress when factoring numbers. The purpose of the whole exercise
is to show the use of nested diagnostic contexts in order to
distinguish the log output from different client requests.
Usage: java org.apache.log4j.examples.NumberCruncherServer configFile
where configFile is a log4j configuration file.
We supply a simple config file factor.lcf
for directing log output to the file factor.log .
Try it yourself by starting a NumberCruncherServer
and make queries from multiple {@link NumberCruncherClient
NumberCruncherClients} to factor numbers.
Sample output shows the log
output when two clients connect to the server near simultaneously.
See source code
of NumberCruncherServer for more details.
Note that class files for the example code is not included in
any of the distributed log4j jar files. You will have to add the
directory /dir-where-you-unpacked-log4j/classes to
your classpath before trying out the examples. |