- Building Serverless Python Web Services with Zappa
- Abdulwahid Abdulhaque Barguzar
- 171字
- 2021-07-16 18:16:15
Tailing logs
Zappa provides a facility for watching the logs related to your deployment. You can simply use the following command:
$ zappa tail production
This will print all logs related to HTTP requests and AWS events. If you want to print logs related to HTTP requests, you can simply pass the --http argument:
$ zappa tail production --http
You can reverse the preceding command with non-HTTP events and log messages by simply using the following code::
$ zappa tail production --non-http
You can also limit the log with respect to time using the --since argument:
$ zappa tail production --since 1h # 1 hour
$ zappa tail production --since 1m # 1 minute
$ zappa tail production --since 1mm # 1 month
You can also filter the logs with the --filter argument, for example:
$ zappa tail production --since 1h --http --filter “POST”
This will show only HTTP POST requests for the last hour. This uses the AWS CloudWatch log-filter pattern (http://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html).
推薦閱讀
- 網(wǎng)絡協(xié)議工程
- Twilio Cookbook
- Learning QGIS 2.0
- Go Web Scraping Quick Start Guide
- NB-IoT物聯(lián)網(wǎng)技術(shù)解析與案例詳解
- CCNP TSHOOT(642-832)認證考試指南
- INSTANT KineticJS Starter
- Windows Server 2012 Hyper-V虛擬化管理實踐
- 深入理解OpenStack Neutron
- 深入理解Nginx:模塊開發(fā)與架構(gòu)解析
- 5G非正交多址接入技術(shù):理論、算法與實現(xiàn)
- Guide to NoSQL with Azure Cosmos DB
- 網(wǎng)絡安全之道
- INSTANT Social Media Marketing with HootSuite
- 黑客與反黑工具使用詳解