|
I plan to add logging into my Windows Form application.
NLog is still looking good for me in my case.
are there any people still using it from codeproject community?
diligent hands rule....
|
|
|
|
|
... this guy:
hehe[^]
Yeah that's what I'm talking about ... hehe ... use'n it. Awright!(sniff)
|
|
|
|
|
thanks for this link!
diligent hands rule....
|
|
|
|
|
We are using Log4Net, which I'm not very fond of, never tried NLog but it seems a better choice.
See overview here: best-net-logging-frameworks[^]
|
|
|
|
|
your input is always insightful for me.
I used this post as a jump start.
diligent hands rule....
|
|
|
|
|
I use nlog - I prefer it to log4net. It's very easily configured, and comes with pre-canned formatters for most situations that you can think of.
|
|
|
|
|
|
The better question is, should I do logging? Seriously. I'm not being facetious. Logging sounds great until, as I've always experienced, there are reams of output to wade through and nobody bothers and they even forget there's logging going on.
What is it you need to log, and when exactly does it need to be logged?
Now granted, years ago my team added logging to every user action (this was a DOS desktop app at that) which was enabled in "QA" mode. We logged the tester's activity, we were able to play it back, and when they said "I did x, y, and z" we could look at the log and say, "no, you did x, A and z" and they were stunned. So that kind of logging was quite useful!
|
|
|
|
|
I think logging exceptions and/or unexpected errors is a must, especially for debugging purposes.
I am not really into informational logging in a Prod environment; maybe, in dev, but not prod.
we have a pageview table that stores all the page view stuff for troubleshooting and metrics for business team.
|
|
|
|
|
Slacker007 wrote: I think logging exceptions and/or unexpected errors is a must, especially for debugging purposes.
Agreed. I've actually become rather brutal about it - I send an email to myself when something critical blows up. I have a few Outlook rules as a result.
|
|
|
|
|
your question is great: my first step is to log some data files that are empty. I downloaded these kinds of files using web API.
I need to know what kind of files are empty.
later on I will go deeper to record exceptions.
diligent hands rule....
|
|
|
|
|
Generally it is useful to use logging on different levels and enable/disable the levels as needed. There might be no need to see any informational messages in certain applications until there is a certain error that you want to inspect. In other cases it might be useful to see verbose things like "user x did action y" all the time. As a rule of thumb I would only log things to which I had a specific use-case in mind or things I knew from experience that they help down the line.
Regarding if logging should be done in general: Yes, please. As someone who writes and uses tools that go through logs all the time I am very grateful for applications that log well - meaning not too much, but at least all errors and warnings.
If you use Windows then you could think about writing events to an eventlog instead of writing text files tho.
|
|
|
|
|
great sharing.
diligent hands rule....
|
|
|
|
|
Having supported numerous systems, I can tell you that Logging Matters.
And with current day abilities to create date/time files, and delete files over 7 days old, etc.
I am fine.
The one issue we ran into was needing INSANE levels of logging to track down a DEEP bug.
7 Days worth of this would overwhelm ANY system. (Think of it as turning on Kernel Debugging)
So, we implemented an in-memory circular log for that level of debugging, and NEVER wrote it to disk,
until an exception occurred. So, we had all of our "good logging", and then we had an INSANE level,
that would usually cover the last couple of minutes before an exception. (to be clear, we trapped the exception,
and added that logging information to the output, along with a stack trace).
Within a few days we had a rare problem isolated (something that happened about every 10,000 sessions).
Yes, we need logging. But be careful, I've seen people logging DB connection credentials! OUCH!
|
|
|
|
|
I still use it - can't see a reason not to
"Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Nop, I always roll my own.
|
|
|
|
|
just write message into a text file?
it turns out my case is simple. I just dump my messages into a text file, which file name is with timestamp.
diligent hands rule....
modified 23-Mar-22 13:21pm.
|
|
|
|
|
Pretty much. Maybe
I don't use logging packages (well, I did in another development life). I live in the embedded world, and for the last slate of products, we rolled our own. I won't get into writing stuff to the file system and worrying about loss of power. What I will tell you to do is to use a comma delimited format for your logging. Think ahead of time what information is useful to you and set up standards. Error levels, associated data. But keep it all comma delimited.
Being able to suck this into Excel is priceless.
Charlie Gilley
“They who can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.” BF, 1759
Has never been more appropriate.
|
|
|
|
|
Why would I use Azure when speed is dependent on my Internet connection, and Sql Server on my computer, or network is much faster (I think)?
Ed
|
|
|
|
|
Depends on what you want.
If you want a mobile DB, that can be accessed by any device, any time, over LAN, WAN, mobile or wired connection then Azure is one way to go.
If you want security, speed, and low cost, then ... ummm ... it probably isn't ...
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Do not think of Azure as an alternative to your development computer.
It is an alternative to the server (farm) hosting your application.
And while Azure and AWS can run virtual machines, it is an outdated way of doing software deployment and you will have limited benefit from running those in Azure.
Docker will start to present some benefits (specifically if you need to run on-prem as well), but a "cloud native" architecture where you use Azure storage solutions, authentications, serverless, messagebus, ... is where you see the full benefit.
|
|
|
|
|
Hey, can you elaborate a bit on how docker will give benefits when running on premis? I use docker a lot in my dev environment but not for deploying to production.
|
|
|
|
|
It tends to eliminate/minimize many environmental/configurational concerns.
The segregation of containerization means that it is less often that environment/configuration changes for system A unexpectedly and negatively impact system B. For example, windows' hosts file. In non-containers, that gets shared with everything sitting on that machine. Containers? Each has its own, and as a matter of creating the container, it's already setup. In the same vein you have less scripting/manual configuration of the hardware/OS on the deployment target as most of that stuff would/should live in the containers.
|
|
|
|
|
Thanks very much for your informative answer. So specifically on the orchestration/management of these containers on lets say a windows VM running in the customers datacentre. Wouldn't you need to also deploy Kubernetes or Red Hat Openshift to deploy these containers in the wild so doesn't that add a level of complexity that a standard deployment doesn't?
|
|
|
|
|
You pretty much need Kubernetes etc for the same features you would need for more advanced VM management (i.e. anything above "start a VM on this server"). If all you need is "start this program on this machine", all you need is "docker run" or maybe "docker-compose up" with containers.
I think a lot of the reason VMs are considered "simple" is because most developers are just given one that is managed on infrastructure that are "other peoples problem". So not really an apples to apples comparison.
|
|
|
|