management.views.loggingΒΆ
Logging setting specific views.
AttributesΒΆ
ClassesΒΆ
Index view. |
|
View to display all log files in the log directory in a table. |
|
Log file detail view, allows to view the content of a single log file without download. |
|
View to download a single log file. |
|
View to download multiple log files as a single archive. |
FunctionsΒΆ
|
Secure a log filename by removing any potentially dangerous characters. |
|
Validate a log filename and return the resolved path if valid. |
|
Handle language Configuration. |
Module ContentsΒΆ
- management.views.logging._secure_log_filename(filename)[source]ΒΆ
Secure a log filename by removing any potentially dangerous characters.
- Parameters:
filename (str) β The filename to secure
- Returns:
The secured filename with dangerous characters removed
- Raises:
Http404 β If the filename is invalid
- Return type:
str
- management.views.logging._validate_log_filename(filename)[source]ΒΆ
Validate a log filename and return the resolved path if valid.
- Parameters:
filename (str) β The filename to validate
- Returns:
The resolved Path object if valid
- Raises:
Http404 β If the filename is invalid or not found
- Return type:
pathlib.Path
- class management.views.logging.IndexView(**kwargs)[source]ΒΆ
Bases:
django.views.generic.base.RedirectViewIndex view.
- management.views.logging.language(request)[source]ΒΆ
Handle language Configuration.
Returns: HTTPResponse
- Parameters:
request (django.http.HttpRequest)
- Return type:
django.http.HttpResponse
- class management.views.logging.LoggingFilesTableView(**kwargs)[source]ΒΆ
Bases:
trustpoint.page_context.PageContextMixin,trustpoint.logger.LoggerMixin,trustpoint.views.base.SortableTableFromListMixin,django.views.generic.list.ListViewView to display all log files in the log directory in a table.
- static _get_first_and_last_entry_date(log_file_path)[source]ΒΆ
- Parameters:
log_file_path (pathlib.Path)
- Return type:
tuple[None | datetime.datetime, None | datetime.datetime]
- class management.views.logging.LoggingFilesDetailsView(**kwargs)[source]ΒΆ
Bases:
trustpoint.page_context.PageContextMixin,trustpoint.logger.LoggerMixin,django.views.generic.TemplateViewLog file detail view, allows to view the content of a single log file without download.
- class management.views.logging.LoggingFilesDownloadView(**kwargs)[source]ΒΆ
Bases:
trustpoint.page_context.PageContextMixin,trustpoint.logger.LoggerMixin,django.views.generic.TemplateViewView to download a single log file.
- class management.views.logging.LoggingFilesDownloadMultipleView(**kwargs)[source]ΒΆ
Bases:
trustpoint.page_context.PageContextMixin,trustpoint.logger.LoggerMixin,django.views.generic.ViewView to download multiple log files as a single archive.