|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.classic.net.SocketServer
public class SocketServer
A SocketNode
based server that uses a different hierarchy for each
client.
<b>Usage:</b> java ch.qos.logback.classic.net.SocketServer port configFile configDir
where <b>port</b> is a part number where the server listens,
<b>configFile</b> is an xml configuration file fed to the JoranConfigurator
and
<b>configDir</b> is a path to a directory containing configuration files, possibly one for each client host.
The configFile
is used to configure the logback default
context that the SocketServer
will use to report on its
actions.
When a new connection is opened from a previously unknown host, say
foo.bar.net
, then the SocketServer
will search
for a configuration file called foo.bar.net.lcf
under the
directory configDir
that was passed as the third argument. If
the file can be found, then a new hierarchy is instantiated and configured
using the configuration file foo.bar.net.lcf
. If and when the
host foo.bar.net
opens another connection to the server, then
the previously configured hierarchy is used.
In case there is no file called foo.bar.net.lcf
under the
directory configDir
, then the generic hierarchy is
used. The generic hierarchy is configured using a configuration file called
generic.lcf
under the configDir
directory. If
no such file exists, then the generic hierarchy will be identical to the
log4j default hierarchy.
Having different client hosts log using different hierarchies ensures the total independence of the clients with respect to their logging settings.
Currently, the hierarchy that will be used for a given request depends on the
IP address of the client host. For example, two separate applicatons running
on the same host and logging to the same server will share the same
hierarchy. This is perfectly safe except that it might not provide the right
amount of independence between applications. The SocketServer
is intended as an example to be enhanced in order to implement more elaborate
policies.
Constructor Summary | |
---|---|
SocketServer(File directory)
|
Method Summary | |
---|---|
static void |
main(String[] argv)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketServer(File directory)
Method Detail |
---|
public static void main(String[] argv) throws Exception
Exception
|
Logback API Version 0.9.8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |