Commit 14b323ec authored by Andre Freyssinet's avatar Andre Freyssinet

Avoid useless stacktraces in log.

parent c31ad8c1
...@@ -1257,16 +1257,18 @@ public final class AgentServer { ...@@ -1257,16 +1257,18 @@ public final class AgentServer {
String tname = dis.readUTF(); String tname = dis.readUTF();
transaction = (Transaction) Class.forName(tname).newInstance(); transaction = (Transaction) Class.forName(tname).newInstance();
} catch (Exception exc) { } catch (Exception exc) {
logmon.log(BasicLevel.FATAL, if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.FATAL,
getName() + ", can't instantiate transaction manager", exc); getName() + ", can't instantiate transaction manager", exc);
throw new Exception("Can't instantiate transaction manager"); throw new Exception("Can't instantiate transaction manager: " + exc.getMessage());
} finally { } finally {
if (dis != null) dis.close(); if (dis != null) dis.close();
} }
try { try {
transaction.init(path); transaction.init(path);
} catch (IOException exc) { } catch (IOException exc) {
logmon.log(BasicLevel.FATAL, if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.FATAL,
getName() + ", can't start transaction manager", exc); getName() + ", can't start transaction manager", exc);
throw new Exception("Can't start transaction manager: " + exc.getMessage()); throw new Exception("Can't start transaction manager: " + exc.getMessage());
} }
...@@ -1544,7 +1546,10 @@ public final class AgentServer { ...@@ -1544,7 +1546,10 @@ public final class AgentServer {
logmon.log(BasicLevel.ERROR, getName() + " jmx failed", exc); logmon.log(BasicLevel.ERROR, getName() + " jmx failed", exc);
} }
} catch (Exception exc) { } catch (Exception exc) {
logmon.log(BasicLevel.ERROR, getName() + "Cannot initialize", exc); if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.ERROR, getName() + " cannot initialize", exc);
else
logmon.log(BasicLevel.ERROR, getName() + " cannot initialize: " + exc.getMessage());
synchronized(status) { synchronized(status) {
// AF: Will be replaced by a BAD_INITIALIZED status allowing the // AF: Will be replaced by a BAD_INITIALIZED status allowing the
// re-initialization.. // re-initialization..
...@@ -1552,7 +1557,10 @@ public final class AgentServer { ...@@ -1552,7 +1557,10 @@ public final class AgentServer {
} }
throw exc; throw exc;
} catch (Throwable t) { } catch (Throwable t) {
if (logmon.isLoggable(BasicLevel.DEBUG))
logmon.log(BasicLevel.ERROR, getName() + "Cannot initialize", t); logmon.log(BasicLevel.ERROR, getName() + "Cannot initialize", t);
else
logmon.log(BasicLevel.ERROR, getName() + " cannot initialize: " + t.getMessage());
synchronized(status) { synchronized(status) {
// AF: Will be replaced by a BAD_INITIALIZED status allowing the // AF: Will be replaced by a BAD_INITIALIZED status allowing the
// re-initialization.. // re-initialization..
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment