Added log rotation for prod config (#32)

This commit is contained in:
Kieran
2024-02-21 12:01:18 -08:00
committed by GitHub
parent c1f30dbd2c
commit 0d29f70a28
3 changed files with 20 additions and 3 deletions
+17
View File
@@ -29,6 +29,8 @@ if config_env() == :prod do
For example: /etc/pinchflat/pinchflat.db
"""
log_path = System.get_env("LOG_PATH", "log/pinchflat.log")
config :pinchflat, yt_dlp_executable: System.find_executable("yt-dlp")
config :pinchflat, Pinchflat.Repo,
@@ -74,6 +76,21 @@ if config_env() == :prod do
],
secret_key_base: secret_key_base
config :pinchflat, :logger, [
{:handler, :file_log, :logger_std_h,
%{
config: %{
type: :file,
file: String.to_charlist(log_path),
filesync_repeat_interval: 5000,
file_check: 5000,
max_no_files: 5,
max_no_bytes: 10_000_000
},
formatter: Logger.Formatter.new()
}}
]
# ## SSL Support
#
# To get SSL working, you will need to add the `https` key