Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "logger"
-
My dad put parental controls on the wifi password, programmed a key logger to get the password.
Hooked ever since
(6 years ago)7 -
"Hey, Root, someone screwed up and now all of our prod servers are running this useless query constantly. I know I already changed your priorities six times in the past three weeks, but: Go fix it! This is higher priority! We already took some guesses at how and supplied the necessary code changes in the ticket, so this shouldn't take you long. Remember, HIGH PRIORITY!"
1. I have no idea how to reproduce it.
2. They have no idea how to reproduce it.
3. The server log doesn't include queries.
4. The application log doesn't include queries.
5. The tooling intercepts and strips out some log entries the legendary devs considered useless. (Tangent: It also now requires a tool to read the logs because log entries are now long json blobs instead of plain text.)
6. The codebase uses different loggers like everywhere, uses a custom logger by default, and often overwrites that custom logger with the default logger some levels in. gg
7. The fixes shown in the ticket are pretty lame. (I've fixed these already, and added one they missed.)
8. I'm sick and tired and burned out and just can't bring myself to care. I'm only doing this so i don't get fired.
9. Why not have the person who screwed this up fix it? Did they quit? I mean, I wouldn't blame them.
Why must everything this company does be so infuriatingly complicated?11 -
I actually talked to my duck. He solved my Server 500 error which said "java.lang.NoSuchFieldError: logger". I had to purge the build .class files and recompile the application and low and behold it runs.
Why is my duck a better debugger than most actual debuggers? He didn't even go to college!11 -
Yesterday the web site started logging an exception “A task was canceled” when making a http call using the .Net HTTPClient class (site calling a REST service).
Emails back n’ forth ..blaming the database…blaming the network..then a senior web developer blamed the logging (the system I’m responsible for).
Under the hood, the logger is sending the exception data to another REST service (which sends emails, generates reports etc.) which I had to quickly re-direct the discussion because if we’re seeing the exception email, the logging didn’t cause the exception, it’s just reporting it. Felt a little sad having to explain it to other IT professionals, but everyone seemed to agree and focused on the server resources.
Last night I get a call about the exceptions occurring again in much larger numbers (from 100 to over 5,000 within a few minutes). I log in, add myself to the large skype group chat going on just to catch the same senior web developer say …
“Here is the APM data that shows logging is causing the http tasks to get canceled.”
FRACK!
Me: “No, that data just shows the logging http traffic of the exception. The exception is occurring before any logging is executed. The task is either being canceled due to a network time out or IIS is running out of threads. The web site is failing to execute the http call to the REST service.”
Several other devs, DBAs, and network admins agree.
The errors only lasted a couple of minutes (exactly 2 minutes, which seemed odd), so everyone agrees to dig into the data further in the morning.
This morning I login to my computer to discover the error(s) occurred again at 6:20AM and an email from the senior web developer saying we (my mgr, her mgr, network admins, DBAs, etc) need to discuss changes to the logging system to prevent this problem from negatively affecting the customer experience...blah blah blah.
FRACKing female dog!
Good news is we never had the meeting. When the senior web dev manager came in, he cancelled the meeting.
Turned out to be a hiccup in a domain controller causing the servers to lose their connection to each other for 2 minutes (1-minute timeout, 1 minute to fully re-sync). The exact two-minute burst of errors explained (and proven via wireshark).
People and their petty office politics piss me off.2 -
1. Slack. Pretty good chat app for dev companies, I use it to prevent people standing next to my desk 40 times a day.
2. Unit testing tools, especially when fully automated using a git master branch hook, something like codeship/jenkins, and a deployment service.
3. Jetbrains IDEs. I love Vim, but Jetbrains makes theming, autocompleting & code style checks with mixed templating languages a breeze.
4. Urxvt terminal. It's a bit of work at the start, but so extremely fast and customizable.
5. Cinnamon or i3. Not really dev tools, but both make it easy to organize many windows.
6. A smart production bug logger. I tend to use Bugsnag, Rollbar or Sentry.
7. A good coffee machine. Preferably some high pressure espresso maker which costs more than the CEO's car, using organic fairtrade hipster beans with a picture of a laughing south american farmer. And don't you dare fuck it up with sugar.
8. Some high quality bars of chocolate. Not to consume yourself, but to offer to coworkers while they wait for you to fix a broken deploy. The importance of office politics is not to be underestimated.1 -
I just got asked by a colleague why do I use different levels of a logger. He said he's been writing code for 10+ years and never needed anything other than Logger.debug() 🤦♂️
Where the fuck these guys get their degrees? 😒22 -
during code review...
peer: "you should pass this variable, and extract the logger from it"
me: "why? it is a 3 line logging function. why not pass the logger instance?"
peer: "because that is our best practice. It is the way we do things"
me: "why is it a best practice?"
peer: "because it is. We use it everywhere!"
me: "No we don't. And I still don't understand why is this a best practice. can you explain?"
peer: gives ups, did not look at the mr, and was not going to.
mr stays open. probably forever.11 -
What features would you want in a logger?
Here's what I'm planning so far:
- Tagged entries for easy scanning of log file
- Support for indenting to group similar sequential entries
- Multiple entry types (normal, info, event, warning, error, fatal, debug, verbose)
- Meta entries, so the logger logging about itself, e.g. disk i/o failures.
- Ability to add custom entry types, including tag, log-level, etc.
- Customizable timestamp function
- Support for JS's async nature -- this equates to passing a unique key per 'thread'; the logger will re-write all the parent blocks for context, if necessary. if that sounds confusing, it's okay; just trust that it makes sense.
- Caching, retries, etc. in the event of disk i/o issues.
- Support for custom writers, allowing you to e.g. write logs to an API rather than console or disk.
How about these features?
- Multiple (named) logs with separate writers (console, disk, etc.)
- Ability to individually enable/disable writing of specific entry types. (want verbose but not info? sure thing, weirdo!)
- Multiple writers per log. Combined with the above, this would allow you to write specific entry types (e.g. error, warning, fatal) to stderr instead of stdout, or to different apis.
- Ability to write the same log entry to multiple logs simultaneously
What do you think of these features?
What other features would you want?
I'm open to suggestions!18 -
Hello devRant, this is going to be my first time posting on the site.
I work for a gaming community on the side, and today one of the managers asked me to implement a blacklist system into the chat and reactivate the previously existing one temporarily. This shouldn't have had any issues and should've been implemented within minutes. Once it was done and tested, I pushed it to the main server. This is the moment I found out the previous developer apparently decided it would be the best idea to use the internal function that verifies that the sender isn't blacklisted or using any blacklisted words as a logger for the server/panel, even though there is another internal function that does all the logging plus it's more detailed than the verification one he used. But the panel he designed to access and log all of this, always expects the response to be true, so if it returns false it would break the addon used to send details to the panel which would break the server. The only way to get around it is by removing the entire panel, but then they lose access to the details not logged to the server.
May not have explained this the best, but the way it is designed is just completely screwed up and just really needs a full redo, but the managers don't want to redo do it since apparently, this is the best way it can be done.7 -
I'm planning on writing an open source (and much improved) version of my logger, but I'm stuck on picking a name :<
So, anyone have naming suggestions for a tagged and branching/nesting logging library? (ES6)
(I don't think "deforestation" is a good choice. sounds kinda bad.)19 -
When you take procrastination to another level... Adding Good looking table style output with emoji in a logging script which is only to be used once in a lifetime 😁2
-
Not work but
Years ago when i was in middle school i wanted to mess with the school computers a bit so i made a desktop shortcut for shutdown and changed the name and icon to google chrome.
The person in charge of the it department freaked out and thought some kind of a massive virus infected everything.
Long story short turns out they had an event logger installed, figured out it was me and what i did...
I nearly got expelled 😑2 -
So this just happened,
Me and my co-worker (we are junior developers) were working on the same bug, it was a post call throwing a server exception.
We had asked for help to debug this issue from a senior developer the day before, he was quite busy with his own tasks.
He is one those kinds who would keep working even if the entire bay is wasting their time, always keeping to himself, needless to say I haven't seen him smile.
Back to my story, he couldn't spare time yesterday so we tried to squash the bug ourselves thinking he might have forgotten we had called him.He then comes out of nowhere, he firsr checks the button bindings, params sent and the call being made.
He then went through the backend code strategically placing the break points, clicks and debugs a few times and then opens the console. BAM!!!!
" D' hell yo !!" Shows up in the console, not just once but multiple times. Turns out I forgot the logger I had placed in the catch block.
He turns to me in super slo-mo looks me in the eye and whispers "what the hell yo!" and kept quite for some time, meanwhile the sense of cringe was slowly creeping on me. That was when he let out a loud blurt and the entire cabin turned to us. Needless to say it was awkward.
His smile was creepy though :/ -
I used to think that I had matured. That I should stop letting my emotions get the better of me. Turns out there's only so much one can bottle up before it snaps.
Allow me to introduce you folks to this wonderful piece of software: PaddleOCR (https://github.com/PaddlePaddle/...). At this time I'll gladly take any free OCR library that isn't Tesseract. I saw the thing, thought: "Heh. 3 lines quick start. Cool.", and the accuracy is decent. I thought it was a treasure trove that I could shill to other people. That was before I found out how shit of a package it is.
First test, I found out that logging is enabled by default. Sure, logging is good. But I was already rocking my own logger, and I wanted it to shut the fuck up about its log because it was noise to the stuffs I actually wanted to log. Could not intercept its logging events, and somehow just importing it set the global logging level from INFO to DEBUG. Maybe it's Python's quirk, who knows. Check the source code, ah, the constructors gaves `show_log` arg to control logging. The fuck? Why? Why not let the user opt into your logs? Why is the logging on by default?
But sure, it's just logging. Surely, no big deal. SURELY, it's got decent documentation that is easily searchable. Oh, oh sweet summer child, there ain't. Docs are just some loosely bundled together Markdowns chucked into /doc. Hey, docs at least. Surely, surely there's something somewhere about all the args to the OCRer constructor somewhere. NOPE! Turns out, all the args, you gotta reference its `--help` switch on the command line. And like all "good" software from academia, unless you're part of academia, it's obtuse as fuck. Fine, fuck it, back to /doc, and it took me 10 minutes of rummaging to find the correct Markdown file that describes the params. And good-fucking-luck to you trying to translate all them command line args into Python constructor params.
"But PTH, you're overreacting!". No, fuck you, I'm not. Guess whose code broke today because of a 4th number version bump. Yes, you are reading correctly: My code broke, because of a 4th number version bump, from 2.6.0.1, to 2.6.0.2, introducing a breaking change. Why? Because apparently, upstream decided to nest the OCR result in another layer. Fuck knows why. They did change the doc. Guess what they didn't do. PROVIDING, A DAMN, RELEASE NOTE. Checked their repo, checked their tags, nothing marking any releases from the 3rd number. All releases goes straight to PyPI, quietly, silently, like a moron. And bless you if you tell me "Well you should have reviewed the docs". If you do that for your project, for all of your dependencies, my condolences.
Could I just fix it? Yes. Without ranting? Yes. But for fuck sake if you're writing software for a wide audience you're kinda expected to be even more sane in your software's structure and release conventions. Not this. And note: The people writing this, aren't random people without coding expertise. But man they feel like they are.5 -
What do you think about my project (Simple Windows keylogger)? https://github.com/xxczaki/logger
Language: C# :)3 -
Recently installed SonarQube and its been amazing to see the level of code quality (or lack thereof)
Some projects have 30 to 60 days of technical debt and I found a few files with a cyclomatic complexity over 100. I’m still learning what the “good” numbers should be.
Yesterday, couple of devs were very proud they were going to start reducing the numbers, they started with one of my solutions that had 5 minutes of technical debt. Yes, 5 minutes.
DevA: “OMG…look at this…it has a cyclomatic complexity of 11…that’s terrible. I thought we were supposed to be professional developers.”
DevB: “And take a look at this, he used the double-slash instead of a triple slash for comments. How does any of code even compile?!”
Me: “Maybe we should tweak some of those SonarQube rules so they make more sense to our code base. We’re never going to use unicode, so all those string culture warnings should go away and code comment formatting? Who cares? Be happy we have comments. I think we should also focus on the bigger fish in that pond. The CRM project is one of the biggest and has a lot of improvement opportunities.”
DevB: “There you go again, don’t bring me problems, bring me solutions..ha ha”
DevA: “Yea, no kidding …hey…did you see the logger? OMG…the whole class is over 25 lines…we gotta split that up into smaller projects so it’s more manageable.”
It’s a good thing our revenue stream isn’t dependent on people getting work done.3 -
It is 7:46PM...
I started debugging at 10:30AM...
.Net native making my app crash at startup... even before the logger can write anything...
Just now, I find out it is because of a 3rd party lib...
"Going crazy" can't even begin to describe today...
I really didn't need this shit today... just not today... -
I like my log messages to indicate automatically where in the code something happened, so that I can easily identify where a message originated from while tracking down problems.
In C/C++ this is nice and easy - write a logging routine, wrap it in macros for the different log levels and have that automatically output __FILE__, __LINE__ etc.
I wanted to do something similar in NodeJS, as I'd found myself manually writing the file name in the log message and then splitting functionality out into new files and it became a mess.
The only way I found to be able to do this was to create an "Error" object and access the "stack" member of it. This is a string containing a stack backtrace, suitable for writing to console/file. I just wanted the filename/line/routine.
So I ended up splitting the string into lines, then for each of the lines, trimming the surrounding spaces (or tabs?), and parsing them to see if the stack entry is inside my logger module. The first entry outside of that module must therefore be the thing that called it, so I then parse out the routine or object and method, filename and line number.
It's a lot of clumsy work but the output is pretty neat. I just wish it were simpler!2 -
Second job
Was the lead dev on an ios/android project. I knew that i was not gonna spend much time there and was using them to add shit to the portfolio. my app is in the playstore and seems to be working fine, can't get credit for it and can't bitch about it either since i burned all bridges with that company. the app is a trucking logger logistics ba type of deal for a local company.
i was paid $400 dllrs a week. Yeah I know, ain't shit in the U.S much less Texas. But the thing gave me perspective:
Android development sucks big balls and ios is way easier and nicer on devs.2 -
Bunyan
Bunyan is a simple and fast JSON logging library for node.js services
Server logs should be structured. JSON's a good format. Let's do that. A log record is one line of JSON.stringify'd output. Let's also specify some common names for the requisite and common fields for a log record.11 -
This literally happened in my current team, and I'm not even an experienced dev yet.
Incident happened like this :
Our team is working on a RCP based on eclipse plugins, which has a headless mode and a GUI mode. Now, in the GUI mode, my manager cum architect thought there are no need of user log files (long story) because the user can see the info on screen, whereas in the headless mode, she wanted me to print the logs onto the console and a log file as well.
Now it just so happened that our team had got a recent addition as a replacement to our lead developer (she left the company) who claimed she had 3 years of expertise and a masters degree, and she was assigned a task. The task was to format a custom file we were generating out of the product (basically dumping info in a file) in a human-readable format. Miss new-addition-masters-degree decided it would be a very good idea to redirect the standard java output stream to a file output stream ( which she used for generating the formatted file ) but somehow never realized that she needed to reset the output stream back to standard output.
Consequences were devastating. I wrote the logic for the logger ( yes, apparently any available logging mechanism won't do it, again, long story ) and had it printing to a file in tmp directory. The logs seemed to be working fine initially but after a few logs, specifically from the point where the formatter started working, all the logs got printed in the formatted file. And this file was supposed to be used by our clients to develop something on top of it. Naturally, I got the heat of it and then naturally, worried and nervous and curious and in a frenzied state of mind, I started debugging.
When I got to the actual fault, I seriously could not decide whether to cry or laugh or call up miss masters and scream at her. I decided to ask her about what the hell she had written and her answer was most of it was written by the developer she replaced, so she didn't know it would cause this much problem. Anyway, I fixed the leak after that and averted the catastrophe.
And that, fellow devs, is the story of how I solved a crisis in my first year at corporate.1 -
Existing code:
Logger class would block the caller, lock a mutex, call CreateFile(), write a single line to the file, unlock the mutex and return.
Improvement:
Added two logging queues and created a thread that will periodically lock one queue and write it to the disk, around 500 entries at a time, while new entries are being inserted into the other queue. Kinda like a bed pan or urine bottle. While emptying one bottle, the logs go into the other one. Added fatal exception handlers so that the log queues are dumped when the application is crashing. When the exception handler is triggered, logging method does not return so that the application STOPS working to make sure there are no "not logged" activities.7 -
My companys custom logging library is not thread safe and has problems with multiple instances of the endproduct as well.1
-
Group assignment: writing a own Java logger component in a group of four, using nothing else than Java SE libraries, Maven and Jenkins. The software must be able to substitute the logger component without recompilation, just by editing the config.xml (setting jar file path and fully qualified class name of the logger).
I asked around on Slack which group is ready for a component exchange, so that we could test the switch. I found another group and I started doing some testing.
Then I got a `java.lang.NoClassDefFoundError: org/apache/log4j/Logger`. I got in touch with my peer from the other group and asked him, if they've been using log4j. Apparently they did, so I told him that the assignment was to write a logger of one's own, not just using log4j. Then he told me: "Uh, ok, I'm going to tell the guy responsible for the logger part about that..."
X-D -
Fuck sequelize, the bloody query generated by the "ORM" give diferent result on the same DB if you trie it on dBeaver (works fine) vs node (shit results).
order DESC have 0 effect on sequelize, but it appears on the logger as part of the query.
I just want to go to sleep ffs.7 -
$logger->log_info("Dumper ln:[" . __LINE__ ."] INFO:" , Dumper(%cmd));
[May 1,2018 12:46] Dumper ln:[1118] INFO: 2018-05-01-T12:46:04
...
day++;
frustration ++;
...
Replaces < , > with < . > in line 1.
[May 1,2018 12:53] Dumper ln:[1183] INFO:$VAR1 = 'SQL dude why?';
Mother of Perl !!! -
What is your Favorite library that you always try to include in your code?
1)Logger
2)Sockets
3)Error Hanlders
4)Other if so mention what is that Library
The above question is for any programming language9 -
yay!!! Another PROD issue on something that we've had PROD issue on and well should be an easy fix... Cuz the root cause is prolly bc the idiot that implemented the logger had no idea what the fuck they were doing... And well the whole team didn't bother to ask me (and never listen to me anyway).... WHO WOULD PROBABLY SHOW THEM HOW THEY FCKED UP...
BUT ....
¯\_(ツ)_/¯1 -
Perfect use of DI in .NET Core project.
> Passed logger object in UI project's controller class constructor.
> Then pass it to internal class.
> Then pass it to business project.
> Then pass it to another class and finally used logger in a method to log exceptions in try-catch1 -
Not a rant, just something that made me laugh way too much. We wanted to test this error logger we made to see if it could report where the error happened, so we wrote a function that just throws an exception. Not sure what to call it, we called it “shitTheBed”.
So it looked like:
service.shitTheBed()
I almost want to leave it there.2 -
Our company's first open source project: https://github.com/digineers/...
It's a Symfony bundle that enables logging changes to entities to allow simple mutation logging systems.
Would love to read some of your opinions :)1 -
After brute forced access to her hardware I spotted huge memory leak spreading on my key logger I just installed. She couldn’t resist right after my data reached her database so I inserted it once more to duplicate her primary key, she instantly locked my transaction and screamed so loud that all neighborhood was broadcasted with a message that exception is being raised. Right after she grabbed back of my stick just to push my exploit harder to it’s limits and make sure all stack trace is being logged into her security kernel log.
Fortunately my spyware was obfuscated and my metadata was hidden so despite she wanted to copy my code into her newly established kernel and clone it into new deadly weapon all my data went into temporary file I could flush right after my stick was unloaded.
Right after deeply scanning her localhost I removed my stick from her desktop and left the building, she was left alone again, loudly complaining about her security hole being exploited.
My work was done and I was preparing to break into another corporate security system.
- penetration tester diaries2 -
I jumped on this NodeJS codebase to quickly implement an additional method in the custom logger. How hard could it be, right?
I implemented the method alright. But I can't find where to use it... There are like 10 different logger instances used in this tiny app and in one place logger is even used as a vessel (holder object) for the client's JWT token (to access it from the interactor).
oh, and it's a javascript app (somehow I assumed that node apps are typescript.. silly me!)
What the fØ©ĸ spaghetty-fest is this!?!?!4 -
Can someone explain to me Java lighting...
There log4j, slf4j, logback. Some are interfaces, others are implementations.
What is the setup so I can basically wit one and forget, or upgrade with the jar amount of code changes?
I need to upgrade log4j 1 to 2 and they changed the package name and how to init it....
Now it's logging.log4j.
And correct me if I'm working, Logger logger = LogMagager.getLogger(Clazz.class)
Does the log4j.properties need changing as well?18 -
I started studing C#(I already studied some languages some C or Python), I never used it because of .NET platform(I hate Microsoft), so in those days I started studing it with Mono.
C# is far better than Java.
So I started a simple project and pushed it on GitHub,
it is a simple logger.
https://github.com/JackSpera/...6 -
So apparently changing the root password on my embedded linux system from the default to anything else breaks ssh. The only error i get is, that the password has "expired".
Dis is gonna take a long time to figure out, cuz no system logger and only serial access...2 -
me on typing on Google ...
How to write a keyboard logger script and upload to a password protected computer?
:xD that evil plan.6 -
Question for developpers : yesterday I discussed with my colleagues at work about "How to log front end with javascript". Anybody has already set up a javascript logger ?1
-
I spent half a day trying to figure out why the app on the staging server does not log in the app log file while it does on the dev server.
Server log said log config file found but could not find the root logger.
Problem was that the directory was readable for the app, but not the logfile configuration file.
Dear devs, when a file is not readable that might be some interesting information one could write into a log. AT LEAST MORE INTERESTING THAN "APPLICATION STARTING..." -
All I wanted was a logger and a counter... that’s it... but multiprocessing in python just has to go and fuck everything up...1
-
me vs my job at mnc laggard part 9/n . previous @ https://devrant.com/rants/6602068/...
====
I think i have now realised why working at corporate MNC sucks: they are reluctant to make a good product for their end users.
- they first come up with feature without a proper planning and research.
- then they are in a rush to release it to live audience by ignoring the possible issues that could arise
- when they see it fail, they are like, okay with that and blame it as a failed experiment
- instead of removing/disabling it, they are okay to keep it remain alive in the app, even if it causes customer inconveneience.
- meanwhile, they put false reports for their higher managers as a success and when an enhancement/modification comes for that feature from the higher up, they again start the loop by pushing a new feature without proper planning and a rush
as a dev, it fuckin kills me. I joined in the middle of one of these ugly loops. The app has a camera feature where the camera will generate voices to take pictures and record video , like "goto next car view" , "close the bonnet and focus", etc while the user follows instructions.
the ticket for me was to just add a flash button to this camera. But the more i dive into it, the more i hate it:
- the existing camera implementation provides api for toggling a camera flash, but when i attached it with a ui button, it would not work
- the existing implementation will send images /videos as direct payload data, resulting in generating very large payload curls . our app has a curl logger and it starts crashing.
- the existing implementation also crashes at uploading videos.
So where does it trouble me?well, I have a ticket to add just a fucking button, but i will have to replace the whole camera module and start from scratch. also the crash causing loggers will need some workarounds, otherwise i could not check the apis. and my manager will be like "why are you taking so long to add a flashlight?" and i would be like "coz i wanna put this flashlight up your -2