Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

read with java a log file outside of the deployed jar folder

My question is can I create a java microservice able to read all the logs of the others microservices?

The exact path of the logs of my 2 deployed microservices is this:

/app/ZZZ/dyn/clients/log/zzz_clients.log
/app/ZZZ/dyn/checkout/log/zzz_checkout.log

Is it possible to create a new spring boot logging microService which will be deployed to this exact path:

/app/ZZZ/dyn/logging/

able to read to logs file of the others 2 microservices?

To be clear the folders:

/app/ZZZ/dyn/clients/

/app/ZZZ/dyn/checkout/

/app/ZZZ/dyn/logging/

are the one containing the following folders/file:

/app/ZZZ/dyn/nameOfMicroservice
|_ BOOT-INF
|_ ZZZ_nameOfMicroservice.jar
|_ META-INF
|_ org

where nameOfMicroservice is the: clients, checkout, logging

I know how to read a file contained inside the project folder but how can I read files external to my logging service jar is deployed?

thanks

like image 233
user2298581 Avatar asked Nov 22 '25 18:11

user2298581


1 Answers

It is recommended implementing a centralized log storage and creating a separate logging service that receives log entries from different microservices and saves them in centralized storage.

Having centralized log storage simplifies logging, log retrieval, analytics, investigation, management and coordination of microservices log data.

Microservices logging best practices every team should know

What makes an effective microservices logging strategy?

like image 140
Eskandar Abedini Avatar answered Nov 24 '25 06:11

Eskandar Abedini



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!