Posts

Showing posts from January, 2022

Logback Changes and Implementation

 In Java, You can use three type of logging implementation 1. Log4j2.x.x 2. Logback core 3. Slf4j  Here Slf4j implementation called as Simple Logging Facade For Java Simple Logging Facade for Java (abbreviated SLF4J) – acts as a facade for different logging frameworks (e.g. java. util. logging, logback, Log4j). In recent time to fix log4j vulnerability, I've came across lot of challenges and spend almost a month on same. So would like to share the easiest and best way for logging mechanisms based on experience. My choice would go to Logback : Logback  is a logging library used for Java-based applications and it starts where the first version of Log4j ends and promises to provide improvements to that.  Official site also says as below: Logback is intended as a successor to the popular log4j project,  picking up where log4j 1.x leaves off . Logback's architecture is quite generic so as to apply under different circumstances. At present time, logback is divided int...

ECMA Script - ES6 Features

 Why Should I Learn ES6? React uses ES6, and you should be familiar with some of the new features like: Classes Arrow Functions Variables (let, const, var) Array Methods like .map() Destructuring Modules Ternary Operator Spread Operator function calc(a,b){ const add = a+b; const sub = a-b; const mul = a*b; const div = a/b; return [add,sub,mul,div]; } const [add,sub,mul,div] = calc(2,2); console.log(calc(2,2));

Log4j2 Changes and Implementation

How to use latest Log4j2 changes into your application? Changing from Log4j-1.x.x version to latest jar Log4j2.17.1 Adding Log4j2 with SLF4J Add below changes into your pom.xml     <!-- This is option, It will automatically get added as indirect dependencies -->     <dependency>         <groupId>org.slf4j</groupId>         <artifactId>slf4j-api</artifactId>         <version>1.7.33</version>     </dependency>     <!-- Binding for Log4J -->     <dependency>         <groupId>org.apache.logging.log4j</groupId>         <artifactId>log4j-slf4j-impl</artifactId>         <version> 2.17.1 </version>     </dependency>    <!-- Log4j2 -->     <dependency>        ...