1. A computer-implemented method for hiding sensitive data in log files, the method implemented by a background program embedded within an operating system, the method comprising: intercepting a write operation of an application; getting content of the write operation, in response to determining that the write operation is for a log file; checking a knowledge base, the knowledge base comprising information for the sensitive data; identifying the sensitive data in the content of the write operation; masking the sensitive data in the content of the write operation, in response to determining that the content of the write operation has the sensitive data to be masked; and writing, in the log file, modified content in which the sensitive data is masked.