Skip to content

Small Fixes #5

@danielbarry

Description

@danielbarry

Installation for the readme says to run: pip install nginx-monitor, but it appears it should be nginx-parser instead: https://pypi.org/project/nginx-parser/0.1/

The time parser cannot handle offsets, instead of '%d/%b/%Y:%H:%M:%S +0000' it should be '%d/%b/%Y:%H:%M:%S %z' here:

TIME_LOCAL_FORMAT = '%d/%b/%Y:%H:%M:%S +0000'
according to documentation on strptime(): https://www.programiz.com/python-programming/datetime/strptime

It would make sense to also be able to override that time string in the configuration too as is done for LOG_FORMAT. Something like:

    def get_time_local_format(self):
        if self.time_local_format is not None:
            return self.time_local_format
        try:
            self.time_local_format = self.yaml_config['nginx']['time_local_format']
        except (KeyError, TypeError):
            self.time_local_format self.TIME_LOCAL_FORMAT
        return self.time_local_format

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions