-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Plugin: Serverless Logs #1691
Conversation
|
||
## Logs Options | ||
|
||
The logs plugin only require the function name you want to fetch the logs for. Other than that there are other options that you can add for extra control: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"requires"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's a current format but IMHO would be better to list all parameters and mark those which are required. It's easy to miss first line about function name.
Really great plugin / great work 👍 ! Added some comments! |
|
||
`Logs` hooks into the [`logs:logs`](/lib/plugins/logs) lifecycle. It will fetch the CloudWatch log group of the provided function and outputs all the log stream events in the terminal. | ||
|
||
## Logs Options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't describe the --function -f option, please add
Thanks for the extra eyes guys! 👀 💃 |
- `--function` or `-f` The function you want to fetch the logs for. **Required** | ||
- `--stage` or `-s` The stage you want to view the function logs for. If not provided, the plugin will use the default stage listed in `serverless.yml`. If that doesn't exist either it'll just fetch the logs from the `dev` stage. | ||
- `--region` or `-r` The region you want to view the function logs for. If not provided, the plugin will use the default region listed in `serverless.yml`. If that doesn't exist either it'll just fetch the logs from the `us-east-1` region. | ||
- `--startTime` A specific unit in time to start fetching logs from. You can use standard date/time (ie: `2010-10-20` or `1469705761`), or simply a "since string" like `30m` (30 minutes), `2h` (2 hours), `3d` (3 days) and so on. We'll just fetch the logs that happened since then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are only dates supported by this syntax: 2010-10-20
or could you also do 2010-10-20 14:30
? Could you make this a little clearer in the text to make sure people know what and how its supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't do 2010-10-20 14:30
because of the space particularly ... it won't work with out CLI as it's not parsed as part of the --startTime
option.
Supported strings are basically anything that can be passed to moment.js
from the supported ISO 8601 strings, except for strings with spaces (due to the issue mentioned above).
I'm gonna update the docs with this info. Thanks for the heads up 💪
@eahefnawy is it possible at the moment to say something like This is a bit of an issue once you have larger logs and want to go back a few days but not see everything since then, but only a small part. Imho its fine if we release it like this right now, but we should create another issue to implement an end-time as well (or implement that right away if its easy) |
What you described is not currently possible. The Furthermore, AWS doesn't really have an end time support, so we'll have to put this in ourselves. Keep in mind that the |
There seem to be a few bugs with tailing in there, |
This PR adds a new logging plugin as described in issue #1654 . You can pass any of the following options:
@pmuens @flomotlik let me know of any updates you have in mind. 🎯