working on logging
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>de.srsoftware</groupId>
|
||||
<artifactId>web4rail</artifactId>
|
||||
<version>1.2.59</version>
|
||||
<version>1.2.60</version>
|
||||
<name>Web4Rail</name>
|
||||
<packaging>jar</packaging>
|
||||
<description>Java Model Railway Control</description>
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
<configuration scan="true" scanPeriod="60 seconds" debug="true">
|
||||
<!-- scan="true" enables automatic updates if config file changes, see http://logback.qos.ch/manual/configuration.html -->
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
|
||||
</encoder>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>INFO</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender" append="false">
|
||||
<file>Web4Rail.log</file>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>DEBUG</level>
|
||||
</filter>
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%15thread] %-5level %logger - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
<logger name="de.srsoftware.web4rail" level="INFO"/>
|
||||
<logger name="de.srsoftware.web4rail.Application" level="INFO"/>
|
||||
<logger name="de.srsoftware.web4rail.Command" level="INFO"/>
|
||||
<logger name="de.srsoftware.web4rail.ControlUnit" level="INFO"/>
|
||||
<logger name="de.srsoftware.web4rail.moving" level="INFO"/>
|
||||
|
||||
<root level="info">
|
||||
<root>
|
||||
<appender-ref ref="FILE" />
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
|
||||
@@ -94,7 +94,7 @@ public class Application extends BaseClass{
|
||||
* @throws SecurityException
|
||||
*/
|
||||
private static Object handle(HashMap<String, String> params) throws IOException, ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException {
|
||||
|
||||
LOG.debug("Application.handle({})",params);
|
||||
String realm = params.get(REALM);
|
||||
if (realm == null) throw new NullPointerException(REALM+" should not be null!");
|
||||
|
||||
@@ -241,7 +241,11 @@ public class Application extends BaseClass{
|
||||
}
|
||||
|
||||
Object response = handle(params);
|
||||
if (isSet(response)) LOG.debug("response ({}): {}",response.getClass().getSimpleName(),response);
|
||||
if (isSet(response)) {
|
||||
if (response instanceof Tag) {
|
||||
LOG.debug("response ({}): {}",response.getClass().getSimpleName(),response.toString().substring(0,30)+"...");
|
||||
} else LOG.debug("response ({}): {}",response.getClass().getSimpleName(),response);
|
||||
}
|
||||
send(client,response instanceof String || response instanceof Tag ? response : plan.html());
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -442,7 +442,6 @@ public class Route extends BaseClass {
|
||||
if (!train.onTrace(startBlock)) startBlock.setTrain(null);
|
||||
}
|
||||
train = null;
|
||||
triggeredContacts.clear();
|
||||
}
|
||||
|
||||
public boolean fireSetupActions() {
|
||||
@@ -822,7 +821,6 @@ public class Route extends BaseClass {
|
||||
train = null;
|
||||
}
|
||||
LOG.debug("chlearing triggeredContacts of {}",this);
|
||||
triggeredContacts.clear();
|
||||
state = State.FREE;
|
||||
return true;
|
||||
}
|
||||
@@ -884,6 +882,7 @@ public class Route extends BaseClass {
|
||||
ActionList startActions = triggeredActions.get(ROUTE_START);
|
||||
if (isSet(startActions) && !startActions.fire(context)) return false; // start actions failed
|
||||
state = State.STARTED;
|
||||
triggeredContacts.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user