Log to /tmp when configured log destination cannot be written to.
commit029d8b6a887efa3d0aa0beebb027747f22602690
authorBrett Chik <bchik@fb.com>
Tue, 23 Nov 2021 22:44:49 +0000 (23 14:44 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Tue, 23 Nov 2021 22:46:31 +0000 (23 14:46 -0800)
tree57c6d065a733d2d61d5df6ff9fd568d20bce8e0c
parentc00bffb928177f58041ba1634129fd25c3d875ac
Log to /tmp when configured log destination cannot be written to.

Summary:
If the destination logfile for Facts cannot be written to, Cronolog will return
nullptr as the output file which then gets used and causes a crash.  Instead,
create a file in /tmp and write to that.

If that also cannot be written to, logging is suppressed.

Reviewed By: jthemphill

Differential Revision: D32405472

fbshipit-source-id: ad7649b8ac5fa14f1e6e91099ad74547e64d0b46
hphp/runtime/ext/facts/logging.cpp