mirror of https://github.com/apache/cloudstack.git
more logging for gson
This commit is contained in:
parent
e4bd357c53
commit
c537d8a00b
|
|
@ -66,6 +66,10 @@
|
|||
<priority value="DEBUG"/>
|
||||
</category>
|
||||
|
||||
<category name="com.cloud.utils.nio">
|
||||
<priority value="INFO"/>
|
||||
</category>
|
||||
|
||||
<!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
|
||||
<category name="org.apache">
|
||||
<priority value="INFO"/>
|
||||
|
|
|
|||
|
|
@ -221,7 +221,12 @@ public class Request {
|
|||
|
||||
public Command[] getCommands() {
|
||||
if (_cmds == null) {
|
||||
_cmds = s_gson.fromJson(_content, Command[].class);
|
||||
try {
|
||||
_cmds = s_gson.fromJson(_content, Command[].class);
|
||||
} catch (RuntimeException e) {
|
||||
s_logger.error("Caught problem with " + _content, e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
return _cmds;
|
||||
}
|
||||
|
|
@ -311,7 +316,12 @@ public class Request {
|
|||
StringBuilder content = new StringBuilder();
|
||||
if (logContent) {
|
||||
if (_cmds == null) {
|
||||
_cmds = s_gson.fromJson(_content, this instanceof Response ? Answer[].class : Command[].class);
|
||||
try {
|
||||
_cmds = s_gson.fromJson(_content, this instanceof Response ? Answer[].class : Command[].class);
|
||||
} catch (RuntimeException e) {
|
||||
s_logger.error("Unable to convert to json: " + _content);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
try {
|
||||
s_gogger.toJson(_cmds, content);
|
||||
|
|
|
|||
Loading…
Reference in New Issue