For log generation in Selenium we can use multiple libraries or techniques:
Log4J: Log4j is a fast, flexible and reliable logging framework (APIS) written in Java developed in early 1996. It is distributed under the Apache Software License. Log4J has been ported to the C, C++, C#, Perl, Python, Ruby and Eiffel Languages. It is a tool used for small to large scale Selenium Automation projects.
ExtentLogger: ExtentLogger outputs logs immediately to console and can be further appended to text files and all other sources supported by slf4j.