What is slf4j :- The Simple
Logging Facade for Java (SLF4J) serves as a simple facade or abstraction for
various logging frameworks (e.g. java.util.logging, logback, log4j) allowing the end user to plug
in the desired logging framework at deployment time.Here we are using log4j2
logging framework at deployment time for this we need to add below jars.
Now create java class with slf4j logger object.
Test.java
import org.slf4j.Logger;
import
org.slf4j.LoggerFactory;
public class Test {
private static final Logger logger = LoggerFactory.getLogger(Test.class);
public static void main(String[] args) {
logger.debug("this is debug
msg");
logger.info("this is info
mesg");
}
}
Now where we
have to store logs and which pattern we have to print logs these are all
configure in log4j2.xml
log4j2.xml
<?xml version="1.0"
encoding="UTF-8"?>
<Configuration>
<Appenders>
<Console name="STDOUT"
target="SYSTEM_OUT">
<PatternLayout pattern="current
date-%d LEVEL-%-5p Thread-[%t] Method-%M() Class
name-%C Message-%m%n"/>
</Console>
</Appenders>
<loggers>
<Logger name="org.apache.log4j.xml"
level="all"/>
<root level="all">
<appender-ref ref="STDOUT"/>
</root>
</loggers>
</Configuration>
Note: the
configuration file log4j2.xml put in class path means under src folder.
wonderful points altogether, you just gained a new reader. What would you recommend in regards to your post that you made some days ago? Any positive?
ReplyDeleteSelenium Online Training Realtime Support From Hyderabad
SQL Server DBA Online Training Realtime Support From Hyderabad
Tableau Online Training Realtime Support From Hyderabad
Testing Tools Online Training Realtime Support From Hyderabad
It is nice blog Thank you porovide important information and i am searching for same information to save my time Ruby on Rails Online Training Hyderabad
ReplyDeleteI found your blog while searching for the updates, I am happy to be here. Very useful content and also easily understandable providing.. Believe me I did wrote an post about tutorials for beginners with reference of your blog.
ReplyDeletebest rpa training in bangalore
rpa training in bangalore
rpa course in bangalore
RPA training in bangalore
rpa training in chennai
rpa online training
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end.
ReplyDeletebest rpa training in bangalore
rpa training in bangalore | rpa course in bangalore
RPA training in bangalore
rpa training in chennai
rpa online training
Well researched article and I appreciate this. The blog is subscribed and will see new topics soon.
ReplyDeletepython Online training in chennai
python training institute in marathahalli
python training institute in btm
Python training course in Chennai
From your discussion I have understood that which will be better for me and which is easy to use. Really, I have liked your brilliant discussion. I will comThis is great helping material for every one visitor. You have done a great responsible person. i want to say thanks owner of this blog.
ReplyDeletepython course institute in bangalore
python Course in bangalore
python training institute in bangalore
That was a great message in my carrier, and It's wonderful commands like mind relaxes with understand words of knowledge by information's.
ReplyDeleteData Science training in chennai
Data Science training in OMR
Data Science training in chennai
Data Science Training in Chennai
Data Science training in Chennai
Data science training in bangalore
A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
ReplyDeleteAWS Training in Bangalore
AWS Training in pune
Your very own commitment to getting the message throughout came to be rather powerful and have consistently enabled employees just like me to arrive at their desired goals.
ReplyDeleteAWS Online Training
AWS Training in Bangalore
Thanks For sharing the Information The Information Shared Is Very valuable please Keep Updating Us The InFormation Shared Is Very Valuable Python Online Training Hadoop Online Training <a href="https://nareshit.com/data-science-online-training/>DataScience Online Training</a>
ReplyDeleteWonderful blog.. Thanks for sharing informative blog.. its very useful to me..
ReplyDeleteaws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore
Really it was an awesome article,very interesting to read.You have provided an nice article,Thanks for sharing.
ReplyDeleteaws Training in Bangalore
python Training in Bangalore
hadoop Training in Bangalore
angular js Training in Bangalore
bigdata analytics Training in Bangalore
python Training in Bangalore
aws Training in Bangalore
ReplyDeleteIt is very good and useful for students and developer.Learned a lot of new things from your post Good creation,thanks for give a good information.
aws training in chennai | aws training in annanagar | aws training in omr | aws training in porur | aws training in tambaram | aws training in velachery
Great post.Excellent information. Java training in Chennai | Certification | Online Course Training | Java training in Bangalore | Certification | Online Course Training | Java training in Hyderabad | Certification | Online Course Training | Java training in Coimbatore | Certification | Online Course Training | Java training in Online | Certification | Online Course Training
ReplyDeleteAttend The Data Scientist Courses From ExcelR. Practical Data Scientist Courses Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Data Scientist Courses. Data Scientist Courses
ReplyDeleteVery nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing.
ReplyDeleteDigital Marketing Training in Chennai
Digital Marketing Course in Chennai
Your amazing insightful information entails much to me and especially to my peers. Thanks a ton; from all of us.
ReplyDeletedata scientist training and placement
coin haber - koin haber - kripto para haberleri - coin haber - instagram video indir - instagram takipçi satın al - instagram takipçi satın al - tiktok takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - instagram takipçi satın al - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - binance güvenilir mi - instagram beğeni satın al - instagram beğeni satın al - google haritalara yer ekleme - btcturk güvenilir mi - binance hesap açma - kuşadası kiralık villa - tiktok izlenme satın al - instagram takipçi satın al - sms onay - paribu sahibi - binance sahibi - btcturk sahibi - paribu ne zaman kuruldu - binance ne zaman kuruldu - btcturk ne zaman kuruldu - youtube izlenme satın al - torrent oyun - google haritalara yer ekleme - altyapısız internet - bedava internet - no deposit bonus forex - erkek spor ayakkabı - tiktok jeton hilesi - tiktok beğeni satın al - microsoft word indir - misli indir - instagram takipçi satın al
ReplyDeleteMua vé tại Aivivu, tham khảo
ReplyDeletevé máy bay đi Mỹ hạng thương gia
vé máy bay từ new york về việt nam
mua ve may bay gia re tu duc ve viet nam
từ nhật bản về việt nam bao nhiêu tiền
ve may bay vietnam airline tu han quoc ve viet nam
các đường bay từ canada về việt nam
khách sạn cách ly ở đà nẵng
Great Article… I love to read your articles because your writing style is too good, its is very very helpful for all of us and I never get bored while reading your article because, they are becomes a more and more interesting from the starting lines until the end…
ReplyDeleteDevOps Training in Hyderabad
instagram takipçi satın al
ReplyDeleteinstagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
instagram takipçi satın al
Thanks for posting the best information and the blog is very gooddata science course in Lucknow
ReplyDeletelaboratory furniture manufacturers in india
ReplyDeleteUGC NET Commerce syllabus
world777 whitelabel
best coaching classes for class 12 in gurgaon
Impressive. Your story always bring hope and new energy. Keep up the good work.
ReplyDeletedata scientist training in malaysia
Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
ReplyDeletefull stack web development course
Cool stuff you have and you keep overhaul every one of us
ReplyDeletebusiness analytics training in hyderabad
mmorpg oyunlar
ReplyDeleteİNSTAGRAM TAKİPÇİ SATİN AL
tiktok jeton hilesi
tiktok jeton hilesi
antalya saç ekimi
referans kimliği nedir
İnstagram Takipçi Satın Al
metin2 pvp serverlar
instagram takipçi satın al
"Shri Mintu's Art forayed into the online furniture space as https://shrimintus.com/
ReplyDeleteto offer value-for-money furniture made of sheesham wood to Indian consumers.
The manufacturer and online seller provides finished
as well as customised products to buyers.
Enjoy a wide variety of traditional and modern living room furniture with shri Mintus Art."
Wooden furniture
Thankyou for giving such informative blogs. Learn Java Course in Greater Noida for more understanding.
ReplyDelete
ReplyDeleteWhyDonate is één van de populairste crowdfunding platforms van alle Europese landen en de Verenigde Staten
WhyDonate is niet alleen geschikt voor het opzetten van fondsenwervende campagnes, maar bevat ook vele actieve fondsenwervers waaraan men kan doneren.
Top 10 crowdfunding platforms in België
Crowdfunding Platfoarm
hfhfh
ReplyDelete