VMware Cloud Community
jetberrocal
Enthusiast
Enthusiast

How do I logrotate third party application log in ESXi 6.0

I installed a third party backup application.  It has a crontab job that generates its own log.

I need to logrotate this log, otherwise eventually this log will become too big.

How do I install or turn on logrotate in ESXi 6.0?

Tags (2)
0 Kudos
6 Replies
vHaridas
Expert
Expert

have you installed backup application on ESXi? or running backup application as VM/Appliance on ESXi Host?

Consider configuring Remote syslog server and forward ESXi and backup application logs to Syslog server.

Configuring syslog on ESXi 5.x and 6.0 (2003322) | VMware KB

Thanks,

vHaridas

http://www.vprhcs.in/

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
0 Kudos
jetberrocal
Enthusiast
Enthusiast

I installed Backup application in ESXi.
I don't like the idea of mixing the backup log with syslog.
I don't like the idea of using a remote syslog server as this will require more hardware and money.

0 Kudos
jetberrocal
Enthusiast
Enthusiast

Please suggest another VMTN forum to address this question

0 Kudos
jetberrocal
Enthusiast
Enthusiast

I posted this question a long time ago but only one person suggested a work around which is not satisfactory for my case.

Requested a suggestion to place the question in other forum in the attempt to get more help, but I have not receive not even that.

Please help.

0 Kudos
vHaridas
Expert
Expert

Hi,

here I am back with another workaround as there is no official solution.

I did some more research on this. ESXi usages VMsyslogd service for logging and log rotation.

configuration files -

/etc/vmsyslog.conf.d/

/etc/vmsyslog.conf

Inside /etc/vmsyslog.conf.d/ directory there are different configuration files for specific service/application log rotation.

You can try to create your own configuration file with new application details and with similar syntax to any old file. save it as .conf

Once you are done, restart ESXi server.

Monitor your application log dir to see if log rotation is happening or not.

I have not tested it, So I would suggest you to test it before implementing it in prod.

I am not sure if such configuration will be even supported by VMware, so better you check with VMware Support.

Also, you can post this question on backup software vendor site if they have any solution for this.

Another way of doing this - Create shell script which will rotate logs.

Good Luck Smiley Happy

-

Haridas

Please consider awarding points for "Correct" or "Helpful" replies. Thanks....!!! https://vprhlabs.blogspot.in/
jetberrocal
Enthusiast
Enthusiast

Sounds promising but I cant test it.  I do not have a Development ESXi Server available at this moment so I will have to wait for another client to make tests before getting it on production.

I found a script that does the job to make versions of the log but the old versions are not removed so the log will not grow indefinitely but the count of files will.  This is OK but not enough as cant let the ESXi unattended.  I am not a bash programmer so I do not know ho to modify it to remove the old files after a certain number of them.

0 Kudos