News for hackers. Stuff that matters.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by dang on Monday July 11, 2022 @10:47PM (#32064987)
Submitted title was "Getting the most from your logs".

Since most of the replies were about that, I'm going to move them underneath this stub.

Please use the original title, unless it is misleading or oh never mind.

Re:How to buck a tree: Cutting logs for maximum yield (2018) by dsimmons on Monday July 11, 2022 @06:13PM (#32062736)
Am I the only one that (wrongly) assumed this was in reference to application logs and not... literal logs? xD
Re:How to buck a tree: Cutting logs for maximum yield (2018) by dopidopHN on Monday July 11, 2022 @06:53PM (#32063196)
I kept scrolling to see what type of software logs that article was about.

While scrolling I was thinking it was the most well researched and involved tongue in cheek intro I read in a while.

Re:How to buck a tree: Cutting logs for maximum yield (2018) by brudgers on Monday July 11, 2022 @07:59PM (#32063835)

  “type of software logs”

  Showing results for *softwood logs*
Re:How to buck a tree: Cutting logs for maximum yield (2018) by m_antis89 on Monday July 11, 2022 @07:52PM (#32063766)
yes
Re:How to buck a tree: Cutting logs for maximum yield (2018) by LewisVerstappen on Monday July 11, 2022 @06:21PM (#32062819)
Very good advice. Great tips on logging when you're working with trees.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by brudgers on Monday July 11, 2022 @10:56PM (#32065042)
Are you saying the title was a clear cut violation?
Re:How to buck a tree: Cutting logs for maximum yield (2018) by manibatra on Monday July 11, 2022 @08:53PM (#32064232)
The one time I decided to open the link first rather than read the comments.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by AbraKdabra on Monday July 11, 2022 @08:45PM (#32064181)
I don't know if you deserve a prize or a ban from HN for using that title.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by dvtrn on Monday July 11, 2022 @09:12PM (#32064348)
Oh for crying out loud

Thanks for the evening chuckle brudgers

Re:How to buck a tree: Cutting logs for maximum yield (2018) by TuringNYC on Monday July 11, 2022 @09:49PM (#32064618)
I kept thinking this was going to be an Allegory for system logs until I realized it was literal
Re:How to buck a tree: Cutting logs for maximum yield (2018) by joshxyz on Monday July 11, 2022 @06:59PM (#32063264)
come on. hahahaha.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by hlieberman on Monday July 11, 2022 @07:47PM (#32063714)
I feel like I just got rick-rolled. I love it; brudgers, you are a mad genius.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by hamasho on Monday July 11, 2022 @10:50PM (#32065003)
I'm redesigning my project's architecture and like "Wow! This article is so timely!" It's exactly what I felt too.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by physicsgraph on Monday July 11, 2022 @08:47PM (#32064196)
The best part of this was getting to the tab I had opened long ago and wondering, "how did I get to this page?" and then realizing (after reading it) that I was rick-rolled by HN.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by helsontaveras18 on Monday July 11, 2022 @09:40PM (#32064553)
Haha love it. Question regarding getting the most from your application logs. My practice is to prefix log statements with the file name and function that’s generating the log. Jumping to that code is just a quick search away. But it does require a bit of manual work to write that extra metadata. I do this because devs just put random logs and it’s so hard to know where they’re coming from. Any best practices?
Re:How to buck a tree: Cutting logs for maximum yield (2018) by jdadj on Monday July 11, 2022 @09:54PM (#32064655)
Not sure about best practices. But at our small shop, we’ve rigged up our homegrown logging infrastructure to do that automatically by using the C/C++ macros __FILE__, __FUNCTION__ and __LINE__

We hide the data in our log viewer to reduce clutter but display it as a tooltip.

Re:How to buck a tree: Cutting logs for maximum yield (2018) by MarkSweep on Monday July 11, 2022 @09:53PM (#32064647)
Various languages have ways of automatically including file paths and line numbers without the caller having to include them every time

C# has CallerFilePathAttribute https://docs.microsoft.com/en-us/dotnet/api/system.runtime.c...

C has the __FILE__, __func__, and __LINE__ pre-processor macros.

Re:How to buck a tree: Cutting logs for maximum yield (2018) by dmckeon on Monday July 11, 2022 @10:40PM (#32064942)
Recently overhauled my rsyslog setup to do timestamps in rfc3339 format. Almost as good as keeping a chain saw chain nicely sharpened, and not replaced backwards!
Re:How to buck a tree: Cutting logs for maximum yield (2018) by mandeepj on Monday July 11, 2022 @07:53PM (#32063781)
The title can be edited to include “Tree” before “Logs”
Re:How to buck a tree: Cutting logs for maximum yield (2018) by whitesilhouette on Monday July 11, 2022 @08:33PM (#32064095)
Nah! This one's better. A mood uplift.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by mandeepj on Monday July 11, 2022 @09:25PM (#32064448)
Alright! Perfect example of a little thing bringing happiness for some :-)
Re:How to buck a tree: Cutting logs for maximum yield (2018) by fnordpiglet on Monday July 11, 2022 @10:39PM (#32064934)
Really I prefer structured logs.
Re:How to buck a tree: Cutting logs for maximum yield (2018) by brudgers on Monday July 11, 2022 @10:50PM (#32065006)
Something like a log cabin maybe?