can anyone explain me about what is the difference between log.utils error, log.error, log.info and ExceptionLog error? [closed] - scala

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
anyone explain me about why and where we use log.info and log.error and logUtils.error and ExceptionLog error. we can also use system.out.println for printing but why we use logs for printing and why we have these many of logs?

Generally we don't use println for logging because there are libraries that are much better at that and configurable. println means that the message is going to be printed to standard output every time, but logging libraries let us define configuration file, outside of code, that defines what log level we want to log to which output for example send it over the network or save it into the file, we can choose the layout of on log line and customize it to get information that is meaningful to us and this is just part of configuration capabilities. Basically we want as much freedom of logging configuration without changing the code as possible. That allows us to define different behaviors across different environments, different configuration for each package etc and helps us to stay consistent throughout whole application.
Practical example is my production application that logs to central log server and send logs over network, besides that it just logs to console, but in my development environment it logs to a file directly. So I can build application in my development environment and deploy it in production without thinking about logging because it depends on the configuration file.

Related

What are the benefits of using a tool like Chef vs. using a makefile/shell script for deployment? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I have heard good things about Chef, was curious about all of the benefits before I devote time to learning a new tool. Not looking to turn this into opinion thread, looking for a list of additional features it has over makefile/shell script.
Chef, and Ansible/Puppet/Salt too (collectively called CAPS), are all based on the structure of "describe the desired state of the system and the tool will make it happen".
A script or Makefile is generally a procedural system, run this, then run that, etc. That means you need to keep a mental model of system from each step to the next, and if that ever deviates from the real system (ex, a directory you are trying to set the owner of doesn't exist) your script usually breaks.
With some stuff this is easy, like yum/apt-get install as they are internally idempotent, you can run them every time and if the package is already installed, it just does nothing.
CAPS systems take that principle (idempotence) and apply it to all management tasks. This has for the most part resulted in less brittle configuration management as you only need to tell the tool what the end result should look like and it will take care of figuring out the delta from the current state.

Logging in Java in 2015 - what does a properly configured environment look like? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
My Eclipse/Tomcat project is a tangled mess of slf4j, log4j, JULI, logback, etc. As a result my console has an abundance of useless messages from various libraries and it is hard to get the logging output I want from my own code. I've resorted to using System.out to get stuff done.
The server deployment environment is in similar bad shape.
What I'm wondering is, where can I find a reference implementation, or checklist, that outlines what a correct configuration of all these logging frameworks is supposed to look like?
I don't know of any examples, but you should try to use slf4j instead of a mixture of logging frameworks. What you can do is use bridges to slf4j instead of the actual libraries. See slf4j documentation on bridges.
There is a slight inconvenience with JUL, but little effort you should be able to control that as well.
I have found I don't like the "Internet wisdom" on this which is exemplified by the diagrams at slf4j.org: it's more complicated than it needs to be, and doesn't address technical debt. Here are my recommendations:
Get rid of log4j. No modern libraries require it, my app shouldn't either.
Bridge slf4j to jdk14.
Bind jcl to jdk14 natively (do not use the jcl-over-slf4j bridge)
Adopt native jdk14 logging in all new code
This seems to provide the simplest configuration with smallest number of config files and directives and fewest surprises.

how to assess the quality of CPAN Perl modules? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
In CPAN, a huge amount of Perl modules are available.
Which is your favourite way / method to assess the quality of a Perl module ? --- in prior to a manual test.
It seems like a rather easy question but it implies an impact. Many modules are buggy and time wasters. And it is not my intention to name a few of them to avoid an unnecessary defamation.
MetaCPAN Metrics: Rating, Bugs, Last Updated
In order to get easy access to these, try searching on metacpan.org instead of cpan.org. It displays number of open bug reports and average rating on the left-hand side, as well as telling you when the module was last updated and gives you an overview of the speed at which changes are made to the module.
You can also easily see a list of dependencies on the right, so you can look for any modules in the groundwork which are less-than-stellar. It doesn't give you any data you can't get on cpan.org, but it does put it all in one place.
Obviously, if you're working on critical infrastructure, nothing is going to replace an old-fashioned code review as you need to be confident not only in the quality of your program but in your understanding of the plumbing, but those are the metrics I usually look at first.

LOG MONITORING/ALERTING APPS [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Hey guys
Our application runs on Jboss/Apache Tomcat and the app is build on Java.
I was wondering if theres a free app out there that let us monitor our log files which are in text format whenever a Jboss exceptions shows up in the log???
At the moment we are using a tail (called BareTail) application that highlights the errors for us and someone has to keep an eye on it.
Any help appreciated thanks.
Since you're using JBoss you also want to take a look at monitoring with JBoss Operations Network (JON) or RHQ the community equivalent to JON.
Some other log monitoring tools/solutions are Chainsaw, Graylog2, Scribe, Lilith, Syslog-ng and Clarity.
Check this free opensource monitoring tool Hyperic.
Among many things it does, log monitoring is one thing.
You can install agents on the servers and configure them and this Log server will collect the information and the logs can be viewed using a webbrowser.
Other tools are Splunk, Tivoli Log Monitoring

Compare Harvest to other source control systems? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
From the top, "source control" seems like a bad way to describe CA Harvest; it's a deployment control system, and it's actually pretty good at just deploying code. I've found it to be lacking when doing source control tasks, though.
If you've used Harvest;
what did it do right?
what couldn't it do?
what did it do with a workaround so hackish it took 3x longer than you'd expect?
(Someone correct me if I'm wrong.) Harvest seems awesome for deployment control, enforcing steps along a deployment lifecycle, and getting a chain of approval for deployments to production. That said, it's missing on the developer-friendly side.
It seems like I need to use the Workareas; they let me put all the code on my local machine, so I can do development.
With Workareas, I can only synchronize from the repository, but not get a report of what just sync'ed in; I don't know what changed, or who changed it, or why.
To add comments to checkins using Workareas, you have to manually enable the functionality in the preferences, which is a huge red flag to me.
I can't seem to figure out how to find out what changed since a specific time; what changed since Friday at 5 PM, for example?
There aren't any atomic commits; I can't commit files as a group, then roll the group back later if something goes wrong. I can do it as a package, but that's heavyweight; a package should be able to contain hundreds of atomic commits/groups.
And worst of all, it's entirely unsupported by Stack Overflow and/or any other question-and-answer site I can find. If I can't figure it out... I'm shooting blind.
We're currently migrating away from Harvest.
Configuration management and code deployment. We have a pretty good process flow going.
Branching and merging. Horrible SCM tool really.
?