Logging is an effective way of peering inside a particular system or process to see what it is doing. Logs are frequently stored line-by-line in files, but it's also common to write log data to terminals/streams (
stderr, for instance) or databases.
Logging makes it possible for developers or sysadmins to find and fix problems without interrupting the flow of the users of the application or system. An error or informative line may be written to a log, where an authorized user may review them and act accordingly. Often, it is not necessary or secure to output log data to the general public, or users of the application.