Hello Jarod,
Which JDK are you using? On JDK 1.5.0, I see
java.lang.ClassCastException: java.lang.String
What happens when you change the while loop to
while (true) {
try {
Integer a = (Integer) m.get("a");
} catch (Exception e) {
e.printStackTrace();
}
}
Jarod Liu wrote:
> Hi all,
> I use slf4j(1.5.2) + logback(0.9.9) to do logging in my applications. I
> enouter a problem, while the load of logging going up, slf4j/logback
> well lost stack trace of a exception. Below is my test program and the
> test output
>
>
>
> correct output:
> ----------------------------------------
> 11:33:38 ERROR [main]log.Logback.main -
> java.lang.ClassCastException: java.lang.String cannot be cast to
> java.lang.Integer
> at log.Logback.main(Logback.java:31)
>
> after some time, output turns to as below:
> --------------------------------------
> 11:44:18 ERROR [main]log.Logback.main -
> java.lang.ClassCastException
>
>
>
> test program:
>
> public class Logback {
>
> private static Logger logger = LoggerFactory.getLogger(Logback.class);
>
>
> public static void main(String[] args) {
> Map m = new HashMap();
> m.put("a", "dsfd");
>
> while (true) {
> try {
> Integer a = (Integer) m.get("a");
>
> } catch (Exception e) {
> logger.error("", e);
> }
> }
> }
> }
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> user mailing list
> [email protected]
> http://www.slf4j.org/mailman/listinfo/user
--
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch
_______________________________________________
user mailing list
[email protected]
http://www.slf4j.org/mailman/listinfo/user