<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>junon</author><text>I think you misunderstand the point of log4j. Logging is not free, and outputting to all three of those is quite expensive (especially in the Docker case, and it can even be dangerous as Docker - at least for a long time - did not implement proper backpressure and instead dropped logs).&lt;p&gt;log4j allows &lt;i&gt;libraries&lt;/i&gt; to implement logging and allow the &lt;i&gt;end user&lt;/i&gt; to worry about where the logs go, at the application level, usually via config on the command line (e.g. modifying classpaths).</text><parent_chain><item><author>linkdd</author><text>The one about using print&amp;#x2F;console.log&amp;#x2F;whatever lol.&lt;p&gt;I&amp;#x27;ve always done this, never have I used a library for this, because:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  - running manually? &amp;gt;myapp.log 2&amp;gt;&amp;amp;1
  - using systemd? use journalctl
  - using docker&amp;#x2F;kubernetes? capture automatically the stdout&amp;#x2F;stderr of your containers and pipe them through logstash or something
&lt;/code&gt;&lt;/pre&gt;
Real question: why would an application need to know where its logs go? This is not in the business perimeter, but the ops perimeter. Am I wrong?&lt;p&gt;EDIT:&lt;p&gt;Most responses are about configuring logging level, output format, etc... This can be done with a print-based approach without sending a request to an external service (which would need to trust you and your inputs).&lt;p&gt;Example: Python&amp;#x27;s default logging module.&lt;p&gt;Still, thank you for your insightful answers :)</text></item></parent_chain></comment><story><title>Log4jmemes.com: for those of us that need a laugh</title><url>https://log4jmemes.com</url></story>
<instructions>Your goal is to analyze the following comment and estimate how highly it will be upvoted by the Hacker News community.</instructions><comment><author>gwbas1c</author><text>Some log libraries allow user configuration of logging. Some configurations can be as mundane as altering logging levels when debugging; other configurations could redirect the logs away from text files to something that preserves semantics.&lt;p&gt;But, depending on what your program is doing, printf&amp;#x2F;whatever can be &amp;quot;good enough.&amp;quot;&lt;p&gt;Coming from the C# world, one of the nice things about log4net is that it has a standard exception formatter, and callbacks whenever anything logs to error. This makes it easier to log unexpected errors and phone home when they happen.</text><parent_chain><item><author>linkdd</author><text>The one about using print&amp;#x2F;console.log&amp;#x2F;whatever lol.&lt;p&gt;I&amp;#x27;ve always done this, never have I used a library for this, because:&lt;p&gt;&lt;pre&gt;&lt;code&gt;  - running manually? &amp;gt;myapp.log 2&amp;gt;&amp;amp;1
  - using systemd? use journalctl
  - using docker&amp;#x2F;kubernetes? capture automatically the stdout&amp;#x2F;stderr of your containers and pipe them through logstash or something
&lt;/code&gt;&lt;/pre&gt;
Real question: why would an application need to know where its logs go? This is not in the business perimeter, but the ops perimeter. Am I wrong?&lt;p&gt;EDIT:&lt;p&gt;Most responses are about configuring logging level, output format, etc... This can be done with a print-based approach without sending a request to an external service (which would need to trust you and your inputs).&lt;p&gt;Example: Python&amp;#x27;s default logging module.&lt;p&gt;Still, thank you for your insightful answers :)</text></item></parent_chain></comment><story><title>Log4jmemes.com: for those of us that need a laugh</title><url>https://log4jmemes.com</url></story>