Redian新闻
>
想起几年前Re: run servlet from command line?
avatar
想起几年前Re: run servlet from command line?# Java - 爪哇娇娃
d*r
1
想起几年以前的糗事:
几年前servlet技术刚出来的时候我就开始用了,但还不会在线调试。
写好code编译后在服务器上跑,靠写log文件进行debug,那叫一个累啊。
后来发现可以在JBuilder里run一个Java Web Server,
通过配置让servlet在Java Web Server里运行,(相当于自己配了一个container)
这样就实现了在IDE环境里调试,那叫一个爽啊。
真后悔没早点引进这个“先进技术”。
而且那时还没有log4j,code里无数的 log语句,简直惨不忍睹。
现在回想起来不堪回首啊。

依赖别的实现,要运行需要container提供环境。启动container当然可以通过command
run
avatar
r*l
2
believe not not, a lot of developers are still doing the same.
No IDE and relying on log4j to debug.

【在 d********r 的大作中提到】
: 想起几年以前的糗事:
: 几年前servlet技术刚出来的时候我就开始用了,但还不会在线调试。
: 写好code编译后在服务器上跑,靠写log文件进行debug,那叫一个累啊。
: 后来发现可以在JBuilder里run一个Java Web Server,
: 通过配置让servlet在Java Web Server里运行,(相当于自己配了一个container)
: 这样就实现了在IDE环境里调试,那叫一个爽啊。
: 真后悔没早点引进这个“先进技术”。
: 而且那时还没有log4j,code里无数的 log语句,简直惨不忍睹。
: 现在回想起来不堪回首啊。
:

avatar
w*g
3
or use Aspect J to insert logging code.

【在 r***l 的大作中提到】
: believe not not, a lot of developers are still doing the same.
: No IDE and relying on log4j to debug.

avatar
m*t
4

I still do. There are so many scenarios that simply won't happen
when you are stepping through the code.
Also I think it promotes proactive logging, which is very helpful
when it gets to post-release maintenance.

【在 r***l 的大作中提到】
: believe not not, a lot of developers are still doing the same.
: No IDE and relying on log4j to debug.

avatar
w*r
5
hehe.. the first time I use Jbuilder to debug my web app, I felt it is soo
sooo cool, now, I still use that debug time by time, however, assert
is much more likely to bse used for a lot of multi-thread component
debug.

【在 d********r 的大作中提到】
: 想起几年以前的糗事:
: 几年前servlet技术刚出来的时候我就开始用了,但还不会在线调试。
: 写好code编译后在服务器上跑,靠写log文件进行debug,那叫一个累啊。
: 后来发现可以在JBuilder里run一个Java Web Server,
: 通过配置让servlet在Java Web Server里运行,(相当于自己配了一个container)
: 这样就实现了在IDE环境里调试,那叫一个爽啊。
: 真后悔没早点引进这个“先进技术”。
: 而且那时还没有log4j,code里无数的 log语句,简直惨不忍睹。
: 现在回想起来不堪回首啊。
:

avatar
h*j
6
it's not bad

【在 r***l 的大作中提到】
: believe not not, a lot of developers are still doing the same.
: No IDE and relying on log4j to debug.

avatar
r*l
7
Agree.
Regardless of the ability of modern IDE, loginer message is very important.
Some developers even remove logging messages from their code after they think
the code is bug free. Very interesting and wrong behavior. lol

【在 m******t 的大作中提到】
:
: I still do. There are so many scenarios that simply won't happen
: when you are stepping through the code.
: Also I think it promotes proactive logging, which is very helpful
: when it gets to post-release maintenance.

avatar
d*r
8
remove logging messages
绝对不是一个好习惯。
log4j做得就已经很好了。
如果更进一步的话可以设一个全局变量:debug
在每一个需要写log的地方:
if (debug)
logger.debug(.........)
这样就足够好了。

think

【在 r***l 的大作中提到】
: Agree.
: Regardless of the ability of modern IDE, loginer message is very important.
: Some developers even remove logging messages from their code after they think
: the code is bug free. Very interesting and wrong behavior. lol

avatar
H*a
9
is this what Log4j supposed to work?

【在 d********r 的大作中提到】
: remove logging messages
: 绝对不是一个好习惯。
: log4j做得就已经很好了。
: 如果更进一步的话可以设一个全局变量:debug
: 在每一个需要写log的地方:
: if (debug)
: logger.debug(.........)
: 这样就足够好了。
:
: think

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。