Merge branch 'bugfix/docker-audit-log' into 'dev'

Ensure audit log exists

See merge request crafty-controller/crafty-4!771
This commit is contained in:
Iain Powrie 2024-06-23 15:36:35 +00:00
commit 522223a36f
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ TBD
### Bug fixes
- Fix zip imports so the root dir selection is functional ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/764))
- Fix bug where full access gives minimal access ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/768))
- Ensure audit.log exists or create it on Crafty startup ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/771))
### Tweaks
- Add info note to default creds file ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/760))
- Remove navigation label from sidebar ([Merge Request](https://gitlab.com/crafty-controller/crafty-4/-/merge_requests/766))

View File

@ -278,6 +278,15 @@ def setup_logging(debug=True):
encoding="utf-8",
).close()
if not helper.check_file_exists(
os.path.join(APPLICATION_PATH, "logs", "audit.log")
):
open(
os.path.join(APPLICATION_PATH, "logs", "audit.log"),
"a",
encoding="utf-8",
).close()
if os.path.exists(logging_config_file):
# open our logging config file
with open(logging_config_file, "rt", encoding="utf-8") as f: