diff --git a/.gitignore b/.gitignore index 08b45e7f62cad23f768c93d617405aed195eed95..88eb1f2830f010f5883434a462e62d8bd2cfdd45 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /config .idea/ /*.ics +DashboardLeaf.log* diff --git a/config/settings-example.json b/config/settings-example.json index f32efc79dd95f7a0eb9b14749afd4a323d90cc2e..cd71316c07b03512a8b9f28844dd6ecc1174ebdb 100644 --- a/config/settings-example.json +++ b/config/settings-example.json @@ -6,5 +6,11 @@ "useSSL": false, "keyfile": "", "certfile": "" + }, + "logging": { + "enableRotatingLogFile": false, + "fileName": "DashboardLeaf.log", + "maxBytes": 2097152, + "numberOfBackups": 3 } } \ No newline at end of file diff --git a/src/DashboardLeaf.py b/src/DashboardLeaf.py index 596799d26f7eb5a7672bd1790a491edc7edaca07..0da8f586fcc2d0b1bd67555812bea41f715538fa 100644 --- a/src/DashboardLeaf.py +++ b/src/DashboardLeaf.py @@ -19,6 +19,14 @@ class DashboardLeaf(FlaskBaseApp): def __init__(self, appName: str): super().__init__(appName, os.path.dirname(__file__), LOGGER, serveRobotsTxt=True, settingsPath=os.path.join(CONFIG_DIR, 'settings.json')) + + loggingSettings = self._settings['logging'] + if loggingSettings['enableRotatingLogFile']: + DefaultLogger.add_rotating_file_handler(LOGGER, + fileName=loggingSettings['fileName'], + maxBytes=loggingSettings['maxBytes'], + backupCount=loggingSettings['numberOfBackups']) + self._tileService = None self._pageManager = None ServiceRegistry.get_instance() diff --git a/src/version.json b/src/version.json index fc0e3ea06dd2a361000e06fc339ac396fb83f832..328402d4fa4caea512b18474d391cf7ce3a18fca 100644 --- a/src/version.json +++ b/src/version.json @@ -1,7 +1,7 @@ { "version": { - "name": "v1.14.0", - "code": 21, - "date": "11.10.21" + "name": "v1.15.0", + "code": 22, + "date": "15.05.21" } } \ No newline at end of file