350-901 practice question 11 of 35
While developing an application following the 12-factor app methodology, which approach should be used in the application for logging?
Full set: 430 questionsDomain Application Deployment and Security
The 12-factor app methodology, under Factor XI: Logs, prescribes that an application should treat logs as event streams. It must not concern itself with the routing or storage of its output. Instead, each running process should write its event stream, unbuffered, to standard output (stdout). The execution environment is then responsible for capturing this stream, collating it with other streams, and routing it to appropriate destinations for analysis and long-term storage. Writing unbuffered ensures that logs are not lost if the application crashes before a buffer is flushed.
A. Writing to a file in the application directory violates the principle that the application should not manage log files itself.
B. Writing to a file in /var/log also violates the principle of decoupling the application from log file management.
C. The methodology explicitly recommends writing unbuffered streams to stdout to ensure immediate capture and prevent log loss.
1. The 12-Factor App Methodology (Canonical Source): "XI. Logs". The official documentation states
"A twelve-factor app never concerns itself with routing or storage of its output stream. It should not attempt to write to or manage logfiles. Instead
each running process writes its event stream
unbuffered
to stdout."
Source: https://12factor.net/logs
2. Official Vendor Documentation (Cloud Foundry): "Application Logging in Cloud Foundry". This documentation for a 12-factor compliant Platform-as-a-Service (PaaS) explains
"Cloud Foundry captures anything written to stdout or stderr by an application... This allows developers to treat logging as a stream and delegate the responsibility of consuming the stream to the platform."
Source: Cloud Foundry Docs
docs.cloudfoundry.org/devguide/deploy-apps/streaming-logs.html
Section: "How Application Logging Works".
3. University Courseware (UC Berkeley): "CS 162: Operating Systems and System Programming
Lecture 22: Cloud Computing". Slide 42 summarizes the 12-factor app principles
stating for Factor XI: "Logs: Treat logs as event streams. Write to stdout/stderr".
Source: UC Berkeley EECS
CS 162
Fall 2018
Lecture 22
Slide 42. https://inst.eecs.berkeley.edu/~cs162/fa18/static/lectures/22-Cloud.pdf
Keep practicing
Take the free 350-901 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other 350-901 practice questions
- Question 2An application has initiated an OAuth authorization code grant flow to get access to an A…
- Question 3A developer is working on an enhancement for an application feature and has made changes …
- Question 4An automated solution is needed to configure VMs in numerous cloud provider environments …
- Question 9A web application is being developed to provide online sales to a retailer. The customers…
- Question 16A user is receiving a 429 Too Many Requests error. Which scheme is the server employing t…
- Question 17What is a well-defined concept of GDPR compliance?
