How to clear microservice log info

Product/components used and version/fix level are you on:

Backend 1015.0.329

Detailed explanation of the problem:

How to clear the Cumulocity microservice log?

Error messages / full error message screenshot / log fileL

N/A

Is your question related to the free trial, or to a production (customer) instance?

Customer instance

Have you installed all the latest fixes for the products and systems you are using?

Yes

Hello,
one possibility would be to restart the microservice.
greets
Helmut

Restarting the microservice would appear to have cleared the log, but in fact it merely “clear screen” if you will and append to the log. If you do a search of old messages, you will find them. Therefore, the log is not cleared.
Any other suggestions?

I’d be interested to hear about the use case for clearing the log entirely.

One thing that should work is to delete the microservice and upload it again. That way the application has a new id and should not be associated with any old logs.

Hello Harald,
are log files included in used storage size? Do we have to pay for it?

greets

Helmut

Hi Helmut,

unfortunately, I cannot give you a definite answer on this. I think as microservice logs are stored separately, they should not be included in the storage size.

Best regards,
Harald

Microservice log files aren’t charged for. They are of a predetermined size and rotated based on size.

https://cumulocity.com/guides/10.15.0/users-guide/administration/#log-files

2 Likes

Hi Harald,

Good to hear from you! Hope you are doing well.

We’ve tried removing the microservice and reinstalling it but we are still seeing old messages when we did a search.

The reason why we were wanting to clear the log is so that during debugging, we will not be confused by old errors or diagnostic messages from an earlier version of the microservice. Looks like we just have to be mindful of the timestamp in the absence of being able to clear the log.

Btw, what is the size of the log so I get a sense of how soon the log could persist until overwritten.

Thanks,
Eddie

Hi,
change the version number of your microservice and deploy it again. Then it should be a new instance for sure.

greets

Helmut

Thanks Helmut!
That works.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.