How to make logs persistent

FlashDrive has a built-in log rotation mechanism. Logs, by default, are stored inside the container temporary drive and wiped out every time the container restart and every day before the backup.

In some cases, it’s important to make logs persistent in order to further analyze them or export them to a log analyzing service.

To make logs persistent :

  • Create a virtual disk inside your app with the path to /var/log (or any specific path related to your app)

Logs are now kept inside the virtual disk instead of the container temporary disk and are included into backups and are never erased.

You can now export your logs using a Filebrowser app installed inside the same stack as your app (available here from the Marketplace).

Depending on your base app software and version you may need to access the disk and remove the current log files before logs are added again.

Logs export and analysis can also be built directly inside your app or via a plugin.

Important : make sure to review and delete your virtual disk usage regularly, the virtual disk space included with each app is limited and overage is billed $0.016/GB/day which can quickly become very expensive.

FlashDrive file architecture automatically detects and treat the virtual disks as part of the container file system, this means you can create a virtual disk with the path /var/log/apache2 and all others log will stays inside the container temporary disk (and not made persistent). This can help save disk space and time.

You can delete the /var/log/ virtual disk at any time, the app will automatically revert to the container temporary disk.

Was this helpful?

0 / 0