简体   繁体   English

Context.getLogger 与 AWS Java Lambdas 中的其他记录器

[英]Context.getLogger vs other loggers in AWS Java Lambdas

The AWS java lambda documentation makes reference to a logger obtained by context.getLogger . AWS java lambda 文档引用了context.getLogger获得的记录器。

What are the benefits of using this logger versus instantiating some other logger from a standard framework (eg slf4j)?使用此记录器与从标准框架(例如 slf4j)实例化其他记录器相比有什么好处?

Thank you in advance for your consideration and response.预先感谢您的考虑和回复。

The primary advantage is that it is included in the Lambda runtime, without needing to be included in your deployment package.主要优点是它包含在 Lambda 运行时中,而无需包含在您的部署包中。 Which keeps your deployment file smaller, which helps a bit with the timing of cold starts.这使您的部署文件更小,这对冷启动的时间有所帮助。

It's also one less thing you have to manage yourself.这也是您必须管理自己的一件事。 For example if you were including Log4J in your deployment, it would be up to you to update the version of Log4J to fix all the security issues with that library.例如,如果您在部署中包含 Log4J,则由您来更新 Log4J 的版本以修复该库的所有安全问题。 Whereas if you are using the included library Amazon would fix any security issues with that for you without you even needing to think about it.而如果您使用包含的库,亚马逊会为您解决任何安全问题,而您甚至不需要考虑它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM