Miserlou/Zappa

How to flush logs?

pcolmer opened this issue · 0 comments

This is part question and part bug report.

During testing of my code, I'm generating a lot of logs. This makes tailing the logs longer and longer so I'd like to have a way of flushing the logs to keep things cleaner.

Furthermore, if the logs accrue somewhere, how do they get expired?

Context

The only way that occurs to me that I can flush the logs is to undeploy and redeploy but the logs continue to exist.

Expected Behavior

I would expect undeploying and redeploying to then result in tail displaying no logs.

Actual Behavior

I continue to see all the previous logs.

Steps to Reproduce

  1. Deploy an app
  2. Tail the logs, generating some log data if necessary
  3. Undeploy the app
  4. Redeploy the app
  5. Tail the logs again - the previous log data is there

Your Environment

  • Zappa version used: 0.52.0
  • Operating System and Python version: Ubuntu 20.04.1 LTS, Python 3.8.5
  • The output of pip freeze:
argcomplete==1.12.2
blinker==1.4
boto3==1.16.56
botocore==1.19.56
cachetools==4.2.0
certifi==2020.12.5
cfn-flip==1.2.3
chardet==4.0.0
click==7.1.2
durationpy==0.5
Flask==1.1.2
future==0.18.2
google-api-core==1.25.0
google-api-python-client==1.12.8
google-auth==1.24.0
google-auth-httplib2==0.0.4
googleapis-common-protos==1.52.0
hjson==3.0.2
httplib2==0.18.1
idna==2.10
itsdangerous==1.1.0
Jinja2==2.11.2
jmespath==0.10.0
JSON-minify==0.3.0
kappa==0.6.0
ldap3==2.8.1
MarkupSafe==1.1.1
pip-tools==5.5.0
placebo==0.9.0
protobuf==3.14.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-dateutil==2.8.1
python-slugify==4.0.1
pytz==2020.5
PyYAML==5.3.1
requests==2.25.1
rsa==4.7
s3transfer==0.3.4
sentry-sdk==0.19.5
six==1.15.0
text-unidecode==1.3
toml==0.10.2
tqdm==4.56.0
troposphere==2.6.3
Unidecode==1.1.2
uritemplate==3.0.1
urllib3==1.26.2
vault-auth @ git+https://github.com/linaro-its/vault_auth.git@5bb93a5a0e04d55a8e926d36c37d3b908ead2f55
Werkzeug==0.16.1
wsgi-request-logger==0.4.6
zappa==0.52.0
  • Your zappa_settings.json:
{
    "dev": {
        "app_function": "app.APP",
        "aws_region": "us-east-1",
        "profile_name": "DevsAdminAccess",
        "project_name": "linaro-sd-webhook",
        "runtime": "python3.8",
        "s3_bucket": "zappa-sd-webhook",
        "keep_warm": false,
        "exclude": [
            ".gitignore",
            ".vscode",
            "boto3*",
            "botocore*",
            "build_cfs.py",
            "copy-repos.sh",
            "Pipfile*",
            "README.md"
        ],
        "extra_permissions": [
            {
                "Effect": "Allow",
                "Action": [
                    "sts:AssumeRole"
                ],
                "Resource": [
                    "arn:aws:iam::621503700583:role/vault_sd_automation"
                ]
            }
        ],
        "log_level": "INFO"
    }
}