log4j日志不正常,不输出到控制台问题

阅读: 评论:0

2024年2月6日发(作者:)

log4j日志不正常,不输出到控制台问题

Did you already got the answer?Their is nearly every possible1

solution explained, so it wouldbe interesting, whether onehelped. – user357206 Sep 2 '10at 7:52add a comment11 Answersactive oldest votesGo to Run configurations in your eclipse then -VM arguments add this: -uration=log4j-config_folder/otereplace log4j-config_folder with your folder structure where you have your file11answered Aug 17 '10 at 12:24downvoteshare|improve this answerHuzi--- Javiator51945Thanks for the suggestion. This way it worked! Although I'm still a bit annoyed for tworeasons: 1) I thought if I used the ure() I didn't have to botherhaving the ties 2) When I run a simple JUnit test I just want to right clik and "run", not having to define a configuration I've tried again my original test, but adding thefollowing line to see if it was using some variable defined somewhere in Eclipse:n(perty("uration")); But it prints out "null" –

javaExpert Aug 17 '10 at 13:50 hmmm.. interesting.. k ll get back to yu – Huzi--- Javiator Aug 18 '10 at 8:59add a commentLook in the

ties or

file for the log level. It's probably set to

ERROR instead ofDEBUGupvoteanswered Aug 17 '10 at 10:158downshare|improve this answervoteAaron Digulla153k36236405Thanks for the reply Aaron. I have checked the ties and it was set on INFO. Ihave now changed it to DEBUG, but it doesn't make any difference. Any other idea?gger=DEBUG, stdout1 ==sionPattern=%t:%d{ddMMMyy HH:mm:} %-5p(%F:%L) %m%n – javaExpert Aug 17 '10 at 10:23add

- to your VM environment startup properties to have log4j print out it'sdebugging info - perhaps a different log4j configuration file is being picked up on the10

classpath (such as one bundled inside a JAR) than the one you intend – matt b Aug 17'10 at 11:35@javaExpert: In that case, it find a different ties somewhere on the into your JARs, too! – Aaron Digulla Aug 17 '10 at 12:23add a comment

up vote 5down voteOne thing to note, if you have a ties file on your classpath you do not need tocall BasicConfigurator. A description of how to configure the properties file is could pinpoint whether your IDE is causing the issue by trying to run this class from the

command line with and ties on your classpath.

log4j日志不正常,不输出到控制台问题

本文发布于:2024-02-06 23:34:18,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170723365962802.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

上一篇:log4j2 jvm参数
下一篇:log4j2工作原理
标签:问题   输出   控制台
留言与评论(共有 0 条评论)
   
验证码:
排行榜

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23