linux 查看tongweb进程,TongWeb日志如何查看?

当使用TongWeb时出现问题,第一处理方式为查看TongWeb logs目录下的server.log。

注意:千万不要在控制台查看日志,排序不规则,浏览行数少,不如直接看server.log。

91820583f71e

image

91820583f71e

image

91820583f71e

image

在出现问题时,首先要收集TongWeb日志server.log,收集规则:

若是必然出现的问题则清理一下 TongWeb 日志, 重新启动 TongWeb, 运行应用后收集从 TongWeb 启动后整个server.log日志。

若是偶然问题的出现, 则保留 TongWeb 从开始运行后的所有日志,** 且需要注明问题出现的时间点或异常日志行数。**

禁止只收集一、 两句的报错信息, 要保证日志的完整性, 应该收集 TongWeb 从启动开始到出现问题时的整个日志。

通常应用采用 log4j 日志输出, 保证应用的 log4j 配置正确, 让应用日志输出在TongWeb 日志中。

日志以文本方式查看最为方便。若条件不允许,用电脑截图要截全,用手机拍照要注意提高拍摄水平、拍正、拍清。

要点:部署异常看server.log日志、线程问题看jstack日志、内存问题看jmap日志、乱码问题分析编码,日志作用不大。

查看server.log日志主要查看应用的报错的根本原因,找到Caused by关键字,例如如下内容。

**Caused by: javax.naming.NameNotFoundException: Name "JDBC/DPORTAL" not found.**

at com.tongweb.tongejb.core.ivm.naming.IvmContext.federate(IvmContext.java:199)

at com.tongweb.tongejb.core.ivm.naming.IvmContext.lookup(IvmContext.java:151)

at com.tongweb.tongejb.core.ivm.naming.OpenejbDelegateContext.lookup(OpenejbDelegateContext.java:48)

at com.tongweb.tongejb.core.ivm.naming.ContextWrapper.lookup(ContextWrapper.java:137)

at com.tongweb.tongejb.core.OpenEJBInitialContextFactory$LocalFallbackContextWrapper.lookup(OpenEJBInitialContextFactory.java:53)

at com.tongweb.naming.SelectorContext.lookup(SelectorContext.java:163)

at com.tongweb.naming.ThanosSelectorContext.lookup(ThanosSelectorContext.java:54)

at javax.naming.InitialContext.lookup(InitialContext.java:417)

at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:155)

at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)

at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:153)

at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:178)

at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)

at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:105)

at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:200)

at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:186)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)

at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)

... 145 more

[2020-11-16 14:41:11] [SEVERE] [core] [One or more listeners failed to start. Full details will be found in the appropriate container log file]

这里是已经失败在解部署,再看下面无意义。

[2020-11-16 14:41:11] [SEVERE] [core] [Context [dportal] startup failed due to previous errors]

[2020-11-16 14:41:11] [INFO] [core] [Closing Spring root WebApplicationContext]

[2020-11-16 14:41:11] [INFO] [deployment] [Undeploying app: /opt/TongWeb7.0/deployment/dportal]

[2020-11-16 14:41:12] [SEVERE] [web-container] [Error deploying web application directory /opt/TongWeb7.0/deployment/dportal]

java.lang.RuntimeException: Start context failed.

at com.tongweb.web.thanos.startup.ThanosHostConfig.deployWar(ThanosHostConfig.java:231)

at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.fireTomcatProcess(ThanosWebtierWebAppBuilder.java:416)

at com.tongweb.tw.thanos.ThanosWebtierWebAppBuilder.deployApplication(ThanosWebtierWebAppBuilder.java:363)

at com.tongweb.deploy.TongWebDeployer.deploy0(TongWebDeployer.java:204)

at com.tongweb.deploy.TongWebDeployer.deploy(TongWebDeployer.java:164)

at com.tongweb.deploy.commands.DeployCommand.deploy(DeployCommand.java:269)

at com.tongweb.console.deployer.service.DeployerService.deploy(DeployerService.java:587)

at com.tongweb.console.deployer.controller.DeployerController.deploy(DeployerController.java:361)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:498)

at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137)

at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296)

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250)

at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237)

at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.createModelAndView(ResteasyHandlerAdapter.java:96)

at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:82)

at org.jboss.resteasy.springmvc.ResteasyHandlerAdapter.handle(ResteasyHandlerAdapter.java:26)

最忌讳的日志提供方式:

1. 只发一句个人认为有问题的日志,上下不连贯,让别人无法分析。

[2020-11-30 13:27:11] [SEVERE] [data-source] [Unable to create initial connections of pool.]

2. 只截取堆栈的中间,看不到开头和结尾的caused by, 让别人无法分析。

91820583f71e

image

3. 拍照模糊不清。

91820583f71e

image

4. 只发个日志,什么问题也不描述,让别人猜。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值