0

I have a distributed process which runs across two different servers (A and B) and I get two different log files A.log and B.log, I need this merged into a single file.

I have referred to following links but I am unable to get a merged file from the same:

Is there something that I am missing?

Edit: I need the logs in something along these lines

service1.log:2016-02-26 11:15:47.561  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Hello from service1. Calling service2
service2.log:2016-02-26 11:15:47.710  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Hello from service2. Calling service3 and then service4
service3.log:2016-02-26 11:15:47.895  INFO [service3,2485ec27856c56f4,1210be13194bfe5,true] 68060 --- [nio-8083-exec-1] i.s.c.sleuth.docs.service3.Application   : Hello from service3
service2.log:2016-02-26 11:15:47.924  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service3 [Hello from service3]
service4.log:2016-02-26 11:15:48.134  INFO [service4,2485ec27856c56f4,1b1845262ffba49d,true] 68061 --- [nio-8084-exec-1] i.s.c.sleuth.docs.service4.Application   : Hello from service4
service2.log:2016-02-26 11:15:48.156  INFO [service2,2485ec27856c56f4,9aa10ee6fbde75fa,true] 68059 --- [nio-8082-exec-1] i.s.c.sleuth.docs.service2.Application   : Got response from service4 [Hello from service4]
service1.log:2016-02-26 11:15:48.182  INFO [service1,2485ec27856c56f4,2485ec27856c56f4,true] 68058 --- [nio-8081-exec-1] i.s.c.sleuth.docs.service1.Application   : Got response from service2 [Hello from service2, response from service3 [Hello from service3] and from service4 [Hello from service4]]
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
sah1
  • 380
  • 1
  • 6
  • 23
  • what do you mean by merge logs, and do you want to do it using zipkin only? If not you can always consider centralised logging solutions. – Anunay Nov 30 '18 at 06:09
  • @Anunay I do not have to stick with Zipkin but couldn't find any better solutions. I have had a look into SocketAppender but couldn't find a good source on integrating the same with sprig boot. – sah1 Nov 30 '18 at 06:13
  • and centralised logging? – Anunay Nov 30 '18 at 06:24
  • https://dzone.com/articles/centralized-logging Led me to Zipking And Spring cloud sleuth but I can't seem to make it work – sah1 Nov 30 '18 at 06:34
  • 1
    Yeah so of those, i have tried elk. Simple steps are to move to logback for logging (not strictly required), use filebeat/logstash to read the content of logs, forward it elastic search and query from kibana. Use the following link (there are others if you search around, i just picked one) https://medium.com/oneclicklabs-io/streaming-spring-boot-application-logs-to-elk-stack-part-1-a68bd7cccaeb – Anunay Nov 30 '18 at 07:07
  • @Anunay thanks for the link! I did what the tutorial mentions but now I am stuck because kibana Couldn't find any Elasticsearch data. I looked up this issue on elastic.co 's forum but couldn't find any solution.Do you know a workaround this issue – sah1 Nov 30 '18 at 13:24
  • 1
    Well, you need to figure out the index, if you have used logstash in the example, it would be coming from index => "logstash-%{+YYYY.MM.dd}". In . kibana are you able to create new index and find logstash* ? – Anunay Dec 01 '18 at 04:31

0 Answers0