当前位置:网站首页>How to view tongweb logs correctly?
How to view tongweb logs correctly?
2022-06-13 05:45:00 【t007321】
When using TongWeb There was a problem , The first processing method is to view TongWeb logs In the catalog server.log.
Be careful : Never view logs on the console , Irregular sorting , Fewer rows to browse , Why don't you just look at it server.log.

When something goes wrong , First collect TongWeb journal server.log, Collection rules :
1. If it is inevitable, clean it up TongWeb journal , Restart TongWeb, Collect data from... After running the application TongWeb After startup, the whole server.log journal .
2. If there is an accidental problem , The retention TongWeb All logs since the start of operation , The time point when the problem occurred or the number of exception log lines should be indicated .
3. It is forbidden to collect only one 、 Two sentences of error information , Ensure the integrity of the log , Should collect TongWeb The entire log from Startup to the time of the problem .
4. Commonly used log4j Log output , Ensure the application of log4j The configuration is correct , Let the application log output in TongWeb In the log .
# log4j Example
log4j.rootLogger=INFO, CONSOLE, ROLLINGFILE
# The console outputs , The application log will be output in TongWeb Of server.log in
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} - %-5p [%t:%C{1}@%L] - %m%n
# Apply its own log file output
log4j.appender.ROLLINGFILE=org.apache.log4j.RollingFileAppender
log4j.appender.ROLLINGFILE.Threshold=DEBUG
log4j.appender.ROLLINGFILE.File=app.log
5. It is most convenient to view logs in the form of text . If conditions do not permit , Use computer screenshots to cut all , Pay attention to improving the shooting level when taking photos with mobile phones 、 Shoot straight 、 Paiqing .
6. Distinguish which are TongWeb Output log 、 What are the application output logs ,server.log in systemout The line represents the application output .
[2021-01-13 13:31:51 101] [WARNING] [http-nio2-8088-exec-4] [systemout] [javax.xml.soap.SOAPException: Unknown Protocol: specified for creating MessageFactory]
The main points of : Deploy 、 Run abnormally server.log journal 、 Garbled code analysis , Logs are not very useful .
see server.log The log is mainly used to view the root causes of application errors , Learn to find the root cause of abnormality , For example, the following .
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]
Here is the deployment that has failed , Look at the following meaningless .
[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)
The following typical cases , Application connection nacos Failure , Actively close the application uninstall .
[com.alibaba.nacos.naming.push.receiver] [systemout] [2021-01-22 17:23:07.286 ERROR 75320 --- [g.push.receiver] com.alibaba.nacos.client.naming : [NA] error while receiving push data
java.net.SocketException: Socket closed
at java.net.PlainDatagramSocketImpl.receive0(Native Method)
at java.net.AbstractPlainDatagramSocketImpl.receive(AbstractPlainDatagramSocketImpl.java:143)
at java.net.DatagramSocket.receive(DatagramSocket.java:812)
at com.alibaba.nacos.client.naming.core.PushReceiver.run(PushReceiver.java:83)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)[2021-01-22 17:23:07.286 INFO 75320 --- [o2-9060-exec-19] com.alibaba.nacos.client.naming : com.alibaba.nacos.client.naming.backups.FailoverReactor do shutdown stop]
[2021-01-22 17:23:07.286 INFO 75320 --- [o2-9060-exec-19] com.alibaba.nacos.client.naming : com.alibaba.nacos.client.naming.core.HostReactor do shutdown stop]
[2021-01-22 17:23:07.287 INFO 75320 --- [o2-9060-exec-19] com.alibaba.nacos.client.naming : com.alibaba.nacos.client.naming.net.NamingProxy do shutdown begin]
[2021-01-22 17:23:07.287 WARN 75320 --- [o2-9060-exec-19] com.alibaba.nacos.client.naming : [NamingHttpClientManager] Start destroying NacosRestTemplate]
[2021-01-22 17:23:07.287 WARN 75320 --- [o2-9060-exec-19] com.alibaba.nacos.client.naming : [NamingHttpClientManager] Destruction of the end]
[2021-01-22 17:23:07.321 INFO 75320 --- [o2-9060-exec-19] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default']
[2021-01-22 17:23:07.324 INFO 75320 --- [o2-9060-exec-19] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closing ...]
[2021-01-22 17:23:07.353 INFO 75320 --- [o2-9060-exec-19] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'scopedTarget.asyncExecutor']
[2021-01-22 17:23:07.394 INFO 75320 --- [o2-9060-exec-19] org.mongodb.driver.connection : Closed connection [connectionId{localValue:2, serverValue:321}] to 192.168.0.101:27017 because the pool has been closed.]
[2021-01-22 17:23:07.396 INFO 75320 --- [o2-9060-exec-19] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'scopedTarget.springSessionRedisTaskExecutor']
[2021-01-22 17:23:07.396 INFO 75320 --- [o2-9060-exec-19] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'scopedTarget.commonAsyncExecutor']
[2021-01-22 17:23:07.401 ERROR 75320 --- [o2-9060-exec-19] o.s.boot.SpringApplication : Application run failed
The most taboo way to provide logs :
1. Just send a lot of logs , No problem is described , Nor does it describe the number of lines and errors in the log when a problem occurs , Let others guess .
2. Only send other people's chat records , Let others see the chat records and analyze the problems .
3. Only send a personal log that I think has problems , Up and down incoherence , Make others unable to analyze .
[2020-11-30 13:27:11] [SEVERE] [data-source] [Unable to create initial connections of pool.]
4. Just intercept the middle of the stack , I can't see the beginning and the end caused by, Make others unable to analyze .

5. The picture is blurred 、 Askew . In the case of computer screen capture , Still use the mobile phone to shoot the screen at the computer .

边栏推荐
- Etcd understanding of microservice architecture
- Three paradigms of MySQL
- 2021.9.30 learning log -postman
- About the solution of pychart that cannot be opened by double clicking
- MySQL advanced query
- Why do so many people hate a-spice
- Getclassloader() returns null, getclassloader() gets null
- 2021.9.29 learning log restful architecture
- JNDI configuration for tongweb7
- Automatic database backup (using Navicat)
猜你喜欢

MySQL fuzzy query and sorting by matching degree

C calls the API and parses the returned JSON string

About Evaluation Metrics

17 servicetask of flowable task

Small project - household income and expenditure software (2)

Pychart error resolution: process finished with exit code -1073741819 (0xc0000005)
![[China & some provinces and cities] JSON file for offline map visualization](/img/ea/0c552e1e133f693b9902c54c2e09c8.jpg)
[China & some provinces and cities] JSON file for offline map visualization

2 first experience of drools

3. Postman easy to use

13 cancelendevent of a flowable end event and compensationthrowing of a compensation event
随机推荐
中断处理过程
13 cancelendevent of a flowable end event and compensationthrowing of a compensation event
Dynamic programming - longest common substring
3. Postman easy to use
No assessment summary
The problem of distinguishing and sharing sessions for multiple applications in tongweb
How to Algorithm Evaluation Methods
MySQL basic query
计算两个时间相差的天数(支持跨月、跨年)
Course outline of market drawing 1- basic knowledge
20 flowable container (event sub process, things, sub process, pool and pool)
使用cmake交叉编译helloworld
Mobile end adaptation scheme
11 signalthrowingevent and signalboundaryevent of flowable signal event
OpenGL馬賽克(八)
10 signalstartevent and signalcatchingevent of flowable signal events
基于 Docker Compose 搭建 Nacos 2(使用 MySQL 进行持久化)
Solution to prompt "permission is required to perform this operation" (file cannot be deleted) when win10 deletes a file
How to set the import / export template to global text format according to the framework = (solve the problem of scientific counting)
A simple recursion problem of linked list