I have an error in the program, which forms a stackTrace very large and with different libraries. If you read it from top to bottom, you can see only all the calling methods from the very beginning of the call, except for the first 2-3. That is something like that

//Псевдокод method1_1(){ method2(); } method1_2(){ method2(); } method1_3(){ method2(); } method2(){ method3(); } method3(){ method4(); } method4(){ method5(); } method5(){ method6(); } 

StackTrace displays only 3-6 methods, but 2 and which of the first methods causes this 2 is not clear. How can you find out? The program is large and logs are written every 0.1-0.001 s. Therefore, to put logging on each method is not an option. I can’t simulate a mistake, it only happens, and for this you need to know which of the methods causes the error. The example shows the first three methods, in fact there are many of them.

PS approximately in such type

 INFO | 2019/04/11 14:23:20 | at com.company.smx.data.dao.impl.UserDaoServiceImpl.updateContractorCouponCount(UserDaoServiceImpl.java:418) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.dao.impl.UserDaoServiceImpl$$FastClassBySpringCGLIB$$8732584e.invoke(<generated>) INFO | 2019/04/11 14:23:20 | at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:700) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) INFO | 2019/04/11 14:23:20 | at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) INFO | 2019/04/11 14:23:20 | at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) INFO | 2019/04/11 14:23:20 | at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.dao.impl.UserDaoServiceImpl$$EnhancerBySpringCGLIB$$c376b217.updateContractorCouponCount(<generated>) INFO | 2019/04/11 14:23:20 | at sun.reflect.GeneratedMethodAccessor936.invoke(Unknown Source) INFO | 2019/04/11 14:23:20 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) INFO | 2019/04/11 14:23:20 | at java.lang.reflect.Method.invoke(Method.java:498) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) INFO | 2019/04/11 14:23:20 | at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58) INFO | 2019/04/11 14:23:20 | at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:132) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:120) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56) INFO | 2019/04/11 14:23:20 | at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:132) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:120) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) INFO | 2019/04/11 14:23:20 | at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) INFO | 2019/04/11 14:23:20 | at com.sun.proxy.$Proxy564.updateContractorCouponCount(Unknown Source) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.mobile.json.feedunits.FeedCoupon.fillParams(FeedCoupon.java:96) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.mobile.utils.FeedCreationFactory.createBySkinType(FeedCreationFactory.java:181) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.mobile.utils.FeedCreationFactory.createBySkinTypeSafe(FeedCreationFactory.java:58) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.mobile.utils.beans.FeedUnitCollector.createFeedKnownSkinType(FeedUnitCollector.java:177) INFO | 2019/04/11 14:23:20 | at com.company.smx.data.mobile.utils.beans.FeedUnitCollector.lambda$feedsUnfinishedCollector$57(FeedUnitCollector.java:117) INFO | 2019/04/11 14:23:20 | at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) INFO | 2019/04/11 14:23:20 | at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) INFO | 2019/04/11 14:23:20 | at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) INFO | 2019/04/11 14:23:20 | at java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:291) INFO | 2019/04/11 14:23:20 | at java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:731) INFO | 2019/04/11 14:23:20 | at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) INFO | 2019/04/11 14:23:20 | at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) INFO | 2019/04/11 14:23:20 | at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) INFO | 2019/04/11 14:23:20 | at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) 

FeedUnitCollector.lambda $ feedsUnfinishedCollector $ 57 (FeedUnitCollector.java:117) This is the 3rd method from pseudo-code, and I don’t know which 1st and 2nd

  • And how do you write logs? would attach even a slice - Stranger in the Q
  • My log goes out standard, that is, throws Exception is added to the method. This is done so that the error message is output to the "above" methods that call each other. It is of standard form and does not provide any useful information regarding the first (calling) method. If all the same will be necessary, I can lay out only tomorrow. - Dred

0