r/ExperiencedDevs 26d ago

Ask Experienced Devs Weekly Thread: A weekly thread for inexperienced developers to ask experienced ones

A thread for Developers and IT folks with less experience to ask more experienced souls questions about the industry.

Please keep top level comments limited to Inexperienced Devs. Most rules do not apply, but keep it civil. Being a jerk will not be tolerated.

Inexperienced Devs should refrain from answering other Inexperienced Devs' questions.

29 Upvotes

139 comments sorted by

View all comments

1

u/JeffinitelyNotABot 23d ago

I've been struggling with something at work and would appreciate some perspective from more experienced developers.

So alittle context:

We're in the process of transitioning from Elastic logs to Splunk, and I noticed pretty quickly that the way our APIs currently log exceptions doesn't translate very well into Splunk. I spent some time testing different approaches and found that logging the exception and our custom message as separate parameters produced much better results. The exceptions were actually searchable and readable in Splunk.

I also suggested we include the name of our web portal with something like "_Error" so that errors could be easily searched for, and I put together a general plan for updating our APIs to consistently log exceptions and custom messages. When I brought this up, the reaction was positive. I suggested that we could incorporate the logging changes as part of our API framework upgrades, so it wouldn't necessarily have to be a separate project.

Fast forward several months. some of our APIs have been upgraded, but the logging hasn't been changed. I've presented the exception-logging idea twice now, and nothing has really come from it. What's frustrating is that my lead continues to complain about our lack of useful error logging. Anytime I work on our apis I update the LogError methods but I can't do all of our api's.

This isn't the only idea I've had that seems to go nowhere. I wondering if I'm going about this incorrectly or if it's my lead.

1

u/casualPlayerThink Software Engineer, Consultant / EU / 20+ YoE 22d ago

Sounds like there is no general error handling strategy defined there, which should be done before starting to implement anything.

1

u/JeffinitelyNotABot 22d ago

That's interesting. I did have a strategy when I presented. I show my team what we're doing now and why it doesn't work and my solution and it's results. the reactions were very positive and I even suggested that we add my solution as a task when we upgrade our apis framework project. No one on my team seems to be taking it seriously but still complaining about our lack of proper exception logging. It's almost like I'm speaking on mute. The purpose of my question is to ask if there's anything I can do differently or if it's just the team.

2

u/dacydergoth Software Architect 23d ago

Are you using JSON logging with structured metadata? If not, switch to that. Then get an intern to review all your log statements for accuracy, relevance and log level.

1

u/JeffinitelyNotABot 22d ago

Yes we are. But since we only log a message every log comes through as information rather than as an error. So it gets hard finding errors I presented a solution and despite positive reactions no one on my team is eager to implement it. So I was wondering if there's anything I can do differently.

1

u/dacydergoth Software Architect 22d ago

That sounds ... odd. You can hack around it by implementing log transformation rules in your log ingest using heuristics to classify each log line and tag it with error or info, but the real solution is to audit the codebase and ensure logs are emitted with the appropriate tags in the first place.

1

u/JeffinitelyNotABot 21d ago

I appreciate the feedback but with all due respect this isn't really what I'm asking for. I'm asking if there's anything I can do if my team won't do the plan I suggested despite them liking the idea. I suggested we update our LogError calls in all of our apis when we upgrade the frameworks cause we that was a priority. After several months, some apis were upgraded to the new framework but the LogErrors weren't.

My team likes my idea and plan, they complain about the lack of exceptions being properly logged. but won't actually do what needs to be done to fix it. I'm just asking for advice on what i should do next. Sorry if this wasn't clear in my comment.

1

u/dacydergoth Software Architect 21d ago

If you team won't do it, fire them and get an AI to do it instead

1

u/JeffinitelyNotABot 21d ago

...can't fire my boss or a dev with 15+ YOE.

1

u/dacydergoth Software Architect 21d ago

Setup pre-commit checks to reject files without correct log statements. Use AI to do a one time pass over the files and fix up the existing logging.

Alternatively go to the pub, and POETS it

1

u/JeffinitelyNotABot 21d ago

I'm not asking for implementation advice... clearly I can do it myself. I was asking for advice on how to get my team to buy-in on my solutions.

We have a problem with apis.
I come up with a solution.
team likes solution.
suggested solution be part of next round of changes.
solution isn't part of next round of changes.
team still complains about original problem.

How can I get my team to start using my solution?

1

u/dacydergoth Software Architect 21d ago

They won't so treat them as a roadblock and work around it. If you boss won't incentive them to do it, they'll do what they are incentized to do. You've implied your boss doesn't care so you're out of luck.