diff --git a/can/io/logger.py b/can/io/logger.py index b50825d3f..478651953 100644 --- a/can/io/logger.py +++ b/can/io/logger.py @@ -345,11 +345,11 @@ def _default_name(self) -> StringPathLike: """Generate the default rotation filename.""" path = pathlib.Path(self.base_filename) new_name = ( - path.stem + path.stem.split(".")[0] + "_" + datetime.now().strftime("%Y-%m-%dT%H%M%S") + "_" + f"#{self.rollover_count:03}" - + path.suffix + + "".join(path.suffixes[-2:]) ) return str(path.parent / new_name)