Skip to content

Commit 0b9a0f8

Browse files
committed
Fix for sep in path to logs files determinition
1 parent e5717ea commit 0b9a0f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

thingsboard_gateway/tb_utility/tb_rotating_file_handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ class TimedRotatingFileHandler(BaseTimedRotatingFileHandler):
1616
def __init__(self, filename, when='h', interval=1, backupCount=0,
1717
encoding=None, delay=False, utc=False, maxBytes=0):
1818
file_path = filename
19+
config_path_sep = sep if file_path.rfind(sep) != -1 else '/'
1920
config_path = environ.get('TB_GW_LOGS_PATH')
20-
original_log_filename = file_path.split(sep)[-1]
21+
original_log_filename = file_path.split(config_path_sep)[-1]
2122

2223
final_filename = original_log_filename.replace('.log', '')
2324
final_filename = TimedRotatingFileHandler.to_snake_case(final_filename)

0 commit comments

Comments
 (0)