The log package allows you to send log messages to the system logging service of your UNIX machine, whereas the syslog Go package, which is part of the log package, allows you to define the logging level and the logging facility your Go program will use.
Usually, most system log files of a UNIX OS can be found under the /var/log directory. However, the log files of many popular services, such as Apache and Nginx, can be found elsewhere, depending on their configuration.
Generally speaking, using a log file to write some information is considered a better practice than writing the same output on the screen for two reasons: firstly, because the output does not get lost as it is stored on a file, and secondly, because you can search and process log files using UNIX tools, such as grep(1), awk(1), and sed(1), which cannot be done when messages are printed on a terminal window.
The log package offers many functions for sending output to the syslog server of a UNIX machine. The list of functions includes log.Printf(), log.Print(), log.Println(), log.Fatalf(), log.Fatalln(), log.Panic(), log.Panicln(), and log.Panicf().