<s>
Apache	O
Log4j	B-Application
is	O
a	O
Java-based	O
logging	B-Application
utility	O
originally	O
written	O
by	O
Ceki	O
Gülcü	O
.	O
</s>
<s>
It	O
is	O
part	O
of	O
the	O
Apache	O
Logging	B-Application
Services	O
,	O
a	O
project	O
of	O
the	O
Apache	O
Software	O
Foundation	O
.	O
</s>
<s>
Log4j	B-Application
is	O
one	O
of	O
several	O
Java	B-Language
logging	I-Language
frameworks	I-Language
.	O
</s>
<s>
Gülcü	O
has	O
since	O
created	O
SLF4J	B-Language
,	O
Reload4j	B-Application
,	O
and	O
Logback	O
which	O
are	O
alternatives	O
to	O
Log4j	B-Application
.	O
</s>
<s>
The	O
Apache	O
Log4j	B-Application
team	O
developed	O
Log4j	B-Application
2	O
in	O
response	O
to	O
the	O
problems	O
of	O
Log4j	B-Application
1.2	O
,	O
1.3	O
,	O
java.util.logging	O
and	O
Logback	O
,	O
addressing	O
issues	O
which	O
appeared	O
in	O
those	O
frameworks	O
.	O
</s>
<s>
In	O
addition	O
,	O
Log4j	B-Application
2	O
offered	O
a	O
plugin	O
architecture	O
which	O
makes	O
it	O
more	O
extensible	O
than	O
its	O
predecessor	O
.	O
</s>
<s>
Log4j	B-Application
2	O
is	O
not	O
backwards	O
compatible	O
with	O
1.x	O
versions	O
,	O
although	O
an	O
"	O
adapter	O
"	O
is	O
available	O
.	O
</s>
<s>
On	O
August	O
5	O
,	O
2015	O
,	O
the	O
Apache	O
Logging	B-Application
Services	O
Project	O
Management	O
Committee	O
announced	O
that	O
Log4j	B-Application
1	O
had	O
reached	O
end	O
of	O
life	O
and	O
that	O
users	O
of	O
Log4j	B-Application
1	O
were	O
advised	O
to	O
upgrade	O
to	O
Apache	O
Log4j	B-Application
2	O
.	O
</s>
<s>
On	O
January	O
12	O
,	O
2022	O
,	O
a	O
forked	O
and	O
renamed	O
log4j	B-Application
version	O
1.2	O
was	O
released	O
by	O
Ceki	O
Gülcü	O
as	O
Reload4j	B-Application
version	O
1.2.18.0	O
with	O
the	O
aim	O
of	O
fixing	O
the	O
most	O
urgent	O
issues	O
in	O
log4j	B-Application
1.2.17	O
that	O
had	O
accumulated	O
since	O
its	O
release	O
in	O
2013	O
.	O
</s>
<s>
On	O
December	O
9	O
,	O
2021	O
,	O
a	O
zero-day	O
vulnerability	O
involving	O
arbitrary	O
code	O
execution	O
in	O
Log4j	B-Application
2	O
was	O
published	O
by	O
the	O
Alibaba	B-General_Concept
Cloud	I-General_Concept
Security	O
Team	O
and	O
given	O
the	O
descriptor	O
"	O
Log4Shell	O
"	O
.	O
</s>
<s>
Apache	O
Log4j	B-Application
2	O
is	O
the	O
successor	O
of	O
Log4j	B-Application
1	O
which	O
was	O
released	O
as	O
GA	O
version	O
in	O
July	O
2014	O
.	O
</s>
<s>
The	O
framework	O
was	O
rewritten	O
from	O
scratch	O
and	O
has	O
been	O
inspired	O
by	O
existing	O
logging	B-Application
solutions	O
,	O
including	O
Log4j	B-Application
1	O
and	O
java.util.logging	O
.	O
</s>
<s>
The	O
main	O
differences	O
from	O
Log4j	B-Application
1	O
are	O
:	O
</s>
<s>
Support	O
for	O
multiple	O
APIs	O
:	O
Log4j	B-Application
2	O
can	O
be	O
used	O
with	O
applications	O
using	O
the	O
Log4j	B-Application
2	O
,	O
Log4j	B-Application
1.2	O
,	O
SLF4J	B-Language
,	O
Commons	O
Logging	B-Application
and	O
java.util.logging	O
(	O
JUL	O
)	O
APIs	O
.	O
</s>
<s>
One	O
of	O
the	O
most	O
recognized	O
features	O
of	O
Log4j	B-Application
2	O
is	O
the	O
performance	O
of	O
the	O
"	O
Asynchronous	O
Loggers	O
"	O
.	O
</s>
<s>
Log4j	B-Application
2	O
makes	O
use	O
of	O
the	O
LMAX	B-Language
Disruptor	I-Language
.	O
</s>
<s>
The	O
library	O
reduces	O
the	O
need	O
for	O
kernel	O
locking	O
and	O
increases	O
the	O
logging	B-Application
performance	O
by	O
a	O
factor	O
of	O
12	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
the	O
same	O
environment	O
Log4j	B-Application
2	O
can	O
write	O
more	O
than	O
18,000,000	O
messages	O
per	O
second	O
,	O
whereas	O
other	O
frameworks	O
like	O
Logback	O
and	O
Log4j	B-Application
1	O
just	O
write	O
<	O
2,000,000	O
messages	O
per	O
second	O
.	O
</s>
<s>
The	O
following	O
table	O
defines	O
the	O
built-in	O
log	O
levels	O
and	O
messages	O
in	O
Log4j	B-Application
,	O
in	O
decreasing	O
order	O
of	O
severity	O
.	O
</s>
<s>
The	O
left	O
column	O
lists	O
the	O
log	O
level	O
designation	O
in	O
Log4j	B-Application
and	O
the	O
right	O
column	O
provides	O
a	O
brief	O
description	O
of	O
each	O
log	O
level	O
.	O
</s>
<s>
Level	O
Description	O
OFF	O
The	O
highest	O
possible	O
rank	O
and	O
is	O
intended	O
to	O
turn	O
off	O
logging	B-Application
.	O
</s>
<s>
Log4j	B-Application
2	O
allows	O
users	O
to	O
define	O
their	O
own	O
log	O
levels	O
.	O
</s>
<s>
Log4j	B-Application
can	O
be	O
configured	O
through	O
a	O
configuration	O
file	O
or	O
through	O
Java	B-Language
code	I-Language
.	O
</s>
<s>
Configuration	O
files	O
can	O
be	O
written	O
in	O
XML	B-Protocol
,	O
JSON	B-General_Concept
,	O
YAML	B-Protocol
,	O
or	O
properties	B-Protocol
file	I-Protocol
format	O
.	O
</s>
<s>
Configuring	O
logging	B-Application
via	O
a	O
file	O
has	O
the	O
advantage	O
that	O
logging	B-Application
can	O
be	O
turned	O
on	O
or	O
off	O
without	O
modifying	O
the	O
application	O
that	O
uses	O
Log4j	B-Application
.	O
</s>
<s>
The	O
application	O
can	O
be	O
allowed	O
to	O
run	O
with	O
logging	B-Application
off	O
until	O
there	O
's	O
a	O
problem	O
,	O
for	O
example	O
,	O
and	O
then	O
logging	B-Application
can	O
be	O
turned	O
back	O
on	O
simply	O
by	O
modifying	O
the	O
configuration	O
file	O
.	O
</s>
<s>
They	O
are	O
the	O
names	O
that	O
are	O
known	O
to	O
the	O
Java	B-Device
application	O
.	O
</s>
<s>
Each	O
logger	O
is	O
independently	O
configurable	O
as	O
to	O
what	O
level	O
of	O
logging	B-Application
(	O
FATAL	O
,	O
ERROR	O
,	O
etc	O
.	O
)	O
</s>
<s>
In	O
early	O
versions	O
of	O
Log4j	B-Application
,	O
these	O
were	O
called	O
category	O
and	O
priority	O
,	O
but	O
now	O
they	O
're	O
called	O
logger	O
and	O
level	O
,	O
respectively	O
.	O
</s>
<s>
Log4j	B-Application
2	O
added	O
Appenders	O
that	O
write	O
to	O
Apache	B-Language
Flume	I-Language
,	O
the	O
Java	B-Language
Persistence	I-Language
API	I-Language
,	O
Apache	B-Language
Kafka	I-Language
,	O
NoSQL	B-General_Concept
databases	O
,	O
Memory-mapped	B-General_Concept
files	I-General_Concept
,	O
Random	O
Access	O
files	O
and	O
ZeroMQ	B-Operating_System
endpoints	O
.	O
</s>
<s>
Multiple	O
Appenders	O
can	O
be	O
attached	O
to	O
any	O
Logger	O
,	O
so	O
it	O
's	O
possible	O
to	O
log	O
the	O
same	O
information	O
to	O
multiple	O
outputs	O
;	O
for	O
example	O
to	O
a	O
file	O
locally	O
and	O
to	O
a	O
socket	B-Protocol
listener	O
on	O
another	O
computer	O
.	O
</s>
<s>
A	O
popular	O
way	O
to	O
format	O
one-line-at-a-time	O
log	B-Application
files	I-Application
is	O
PatternLayout	O
,	O
which	O
uses	O
a	O
pattern	O
string	O
,	O
much	O
like	O
the	O
C	B-Language
/	O
C++	B-Language
function	O
printf	B-Language
.	O
</s>
<s>
There	O
are	O
also	O
HTMLLayout	O
and	O
XMLLayout	O
formatters	O
for	O
use	O
when	O
HTML	B-Language
or	O
XML	B-Protocol
formats	O
are	O
more	O
convenient	O
,	O
respectively	O
.	O
</s>
<s>
Log4j	B-Application
2	O
added	O
Layouts	O
for	O
CSV	O
,	O
Graylog	O
Extended	O
Log	O
Format	O
(	O
GELF	O
)	O
,	O
JSON	B-General_Concept
,	O
YAML	B-Protocol
and	O
RFC-5424	O
.	O
</s>
<s>
In	O
Log4j	B-Application
2	O
,	O
Filters	O
can	O
be	O
defined	O
on	O
configuration	O
elements	O
to	O
give	O
more	O
fine-grained	O
control	O
over	O
which	O
log	O
entries	O
should	O
be	O
processed	O
by	O
which	O
Loggers	O
and	O
Appenders	O
.	O
</s>
<s>
In	O
addition	O
to	O
filtering	O
by	O
log	O
level	O
and	O
regular	O
expression	O
matching	O
on	O
the	O
message	O
string	O
,	O
Log4j	B-Application
2	O
added	O
burst	O
filters	O
,	O
time	O
filters	O
,	O
filtering	O
by	O
other	O
log	O
event	O
attributes	O
like	O
Markers	O
or	O
Thread	O
Context	O
Map	O
and	O
JSR	B-Language
223	I-Language
script	O
filters	O
.	O
</s>
<s>
In	O
Log4j	B-Application
2	O
configurations	O
set	O
the	O
status	O
attribute	O
to	O
TRACE	O
to	O
send	O
internal	O
status	O
logging	B-Application
output	O
to	O
standard	B-Operating_System
out	I-Operating_System
.	O
</s>
<s>
To	O
enable	O
status	O
logging	B-Application
before	O
the	O
configuration	O
is	O
found	O
,	O
use	O
the	O
Java	B-Device
VM	O
property	O
-Dorg.apache.logging.log4j.simplelog.StatusLogger.level	O
=	O
trace	O
.	O
</s>
<s>
In	O
Log4j	B-Application
1	O
,	O
use	O
the	O
Java	B-Device
VM	O
property	O
-Dlog4j.debug	O
.	O
</s>
<s>
To	O
find	O
out	O
where	O
a	O
log4j2.xml	O
configuration	O
file	O
was	O
loaded	O
from	O
inspect	O
getClass( )	O
.getResource	O
("/	O
log4j2.xml	O
"	O
)	O
.	O
</s>
<s>
There	O
is	O
also	O
an	O
implicit	O
"	O
unconfigured	O
"	O
or	O
"	O
default	O
"	O
configuration	O
of	O
Log4j	B-Application
,	O
that	O
of	O
a	O
Log4j-instrumented	O
Java	B-Device
application	O
which	O
lacks	O
any	O
Log4j	B-Application
configuration	O
.	O
</s>
<s>
This	O
prints	O
to	O
stdout	O
a	O
warning	O
that	O
the	O
program	O
is	O
unconfigured	O
,	O
and	O
the	O
URL	O
to	O
the	O
Log4j	B-Application
web	O
site	O
where	O
details	O
on	O
the	O
warning	O
and	O
configuration	O
may	O
be	O
found	O
.	O
</s>
<s>
As	O
well	O
as	O
printing	O
this	O
warning	O
,	O
an	O
unconfigured	O
Log4j	B-Application
application	O
will	O
only	O
print	O
ERROR	O
or	O
FATAL	O
log	O
entries	O
to	O
standard	B-Operating_System
out	I-Operating_System
.	O
</s>
<s>
TTCC	O
is	O
a	O
message	O
format	O
used	O
by	O
log4j	B-Application
.	O
</s>
<s>
Mnemonic	O
Description	O
%r	O
Used	O
to	O
output	O
the	O
number	O
of	O
milliseconds	O
elapsed	O
from	O
the	O
construction	O
of	O
the	O
layout	O
until	O
the	O
creation	O
of	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
%t	O
Used	O
to	O
output	O
the	O
name	O
of	O
the	O
thread	O
that	O
generated	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
%p	O
Used	O
to	O
output	O
the	O
priority	O
of	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
%c	O
Used	O
to	O
output	O
the	O
category	O
of	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
%x	O
Used	O
to	O
output	O
the	O
NDC	O
(	O
nested	O
diagnostic	O
context	O
)	O
associated	O
with	O
the	O
thread	O
that	O
generated	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
%X{key}	O
Used	O
to	O
output	O
the	O
MDC	O
(	O
mapped	O
diagnostic	O
context	O
)	O
associated	O
with	O
the	O
thread	O
that	O
generated	O
the	O
logging	B-Application
event	O
for	O
specified	O
key	O
.	O
</s>
<s>
%m	O
Used	O
to	O
output	O
the	O
application	O
supplied	O
message	O
associated	O
with	O
the	O
logging	B-Application
event	O
.	O
</s>
<s>
467	O
 [ main ] 	O
INFO	O
org.apache.log4j.examples.Sort	O
-	O
Exiting	O
main	O
method	O
.	O
</s>
<s>
log4c	O
-	O
A	O
port	O
for	O
C	B-Language
.	O
Log4C	O
is	O
a	O
C-based	O
logging	B-Application
library	O
,	O
released	O
on	O
SourceForge	B-Application
under	O
the	O
LGPL	B-Application
license	I-Application
.	O
</s>
<s>
For	O
various	O
Unix	B-Application
operating	I-Application
systems	I-Application
the	O
autoconf	B-Application
and	O
automake	B-Application
files	O
are	O
provided	O
.	O
</s>
<s>
On	O
Windows	B-Application
a	O
Makefile	O
is	O
provided	O
for	O
use	O
with	O
MSVC	B-Application
.	O
</s>
<s>
Developers	B-Application
may	O
also	O
choose	O
to	O
use	O
their	O
own	O
make	O
system	O
to	O
compile	O
the	O
source	O
,	O
depending	O
on	O
their	O
build	O
engineering	O
requirements	O
.	O
</s>
<s>
An	O
instance	O
of	O
the	O
log4c	O
library	O
may	O
be	O
configured	O
via	O
three	O
methods	O
:	O
using	O
environment	O
variables	O
,	O
programmatically	O
,	O
or	O
via	O
XML	B-Protocol
configuration	O
file	O
.	O
</s>
<s>
log4c	O
has	O
appenders	O
for	O
Files	O
,	O
Streams	O
and	O
memory	B-General_Concept
mapped	I-General_Concept
files	I-General_Concept
.	O
</s>
<s>
(	O
No	O
Socket	B-Protocol
Adapter	O
.	O
)	O
</s>
<s>
log4js	B-Application
-	O
A	O
port	O
for	O
JavaScript	B-Language
.	O
</s>
<s>
Log4js	B-Application
is	O
available	O
under	O
the	O
licence	O
of	O
Apache	O
Software	O
Foundation	O
.	O
</s>
<s>
One	O
special	O
feature	O
of	O
Log4js	B-Application
is	O
the	O
ability	O
to	O
log	O
the	O
events	O
of	O
the	O
browser	O
remotely	O
on	O
the	O
server	O
.	O
</s>
<s>
Using	O
Ajax	B-General_Concept
it	O
is	O
possible	O
to	O
send	O
the	O
logging	B-Application
events	O
in	O
several	O
formats	O
(	O
XML	B-Protocol
,	O
JSON	B-General_Concept
,	O
plain	O
ASCII	B-Protocol
,	O
etc	O
.	O
)	O
</s>
<s>
The	O
following	O
appenders	O
are	O
implemented	O
for	O
log4js	B-Application
:	O
AjaxAppender	O
,	O
ConsoleAppender	O
,	O
FileAppender	O
,	O
JSConsoleAppender	O
,	O
MetatagAppender	O
,	O
and	O
WindowsEventsAppender	O
.	O
</s>
<s>
log4javascript	O
-	O
Another	O
port	O
for	O
JavaScript	B-Language
.	O
</s>
<s>
log4javascript	O
is	O
a	O
JavaScript	B-Language
logging	B-Application
framework	O
based	O
on	O
the	O
log4j	B-Application
.	O
</s>
<s>
JSNLog	O
-	O
A	O
port	O
for	O
JavaScript	B-Language
.	O
</s>
<s>
Automatically	O
places	O
messages	O
from	O
JavaScript	B-Language
loggers	O
in	O
server	O
side	O
logs	O
using	O
a	O
.NET	B-Application
server	I-Application
side	O
component	O
that	O
interfaces	O
with	O
Log4Net	O
,	O
NLog	O
,	O
Elmah	O
or	O
Common.Logging	O
.	O
</s>
<s>
Supports	O
exception	O
logging	B-Application
including	O
stack	O
traces	O
.	O
</s>
<s>
Apache	O
Log4net	O
-	O
A	O
port	O
to	O
the	O
Microsoft	B-Application
.NET	I-Application
Framework	I-Application
.	O
</s>
<s>
The	O
framework	O
is	O
similar	O
to	O
the	O
original	O
log4j	B-Application
while	O
taking	O
advantage	O
of	O
new	O
features	O
in	O
the	O
.NET	B-Application
runtime	O
.	O
</s>
<s>
log4perl	O
-	O
A	O
Perl	B-Language
port	O
of	O
log4j	B-Application
.	O
</s>
<s>
Apache	O
log4php	O
-	O
"	O
A	O
versatile	O
logging	B-Application
framework	O
for	O
PHP	B-Application
.	O
</s>
<s>
Originally	O
a	O
port	O
of	O
Apache	O
log4j	B-Application
to	O
PHP	B-Application
,	O
it	O
has	O
grown	O
to	O
include	O
various	O
PHP	B-Application
specific	O
features.	O
"	O
</s>
<s>
PL-SQL-Logging-Utility	O
is	O
an	O
adaptation	O
of	O
log4j	B-Application
in	O
PL/SQL	O
.	O
</s>
<s>
Log4db2	O
is	O
a	O
logging	B-Application
utility	O
for	O
DB2	O
for	O
LUW	O
that	O
uses	O
SQL	O
instructions	O
with	O
SQL	O
PL	O
code	O
.	O
</s>
<s>
Apache	O
Log4cxx	O
-	O
A	O
logging	B-Application
framework	O
for	O
C++	B-Language
patterned	O
after	O
Apache	O
log4j	B-Application
,	O
which	O
uses	O
Apache	B-Language
Portable	I-Language
Runtime	I-Language
for	O
most	O
platform-specific	O
code	O
and	O
should	O
be	O
usable	O
on	O
any	O
platform	O
supported	O
by	O
APR	O
.	O
</s>
<s>
Log4r	O
-	O
A	O
comprehensive	O
and	O
flexible	O
logging	B-Application
library	O
written	O
in	O
Ruby	O
for	O
use	O
in	O
Ruby	O
programs	O
.	O
</s>
<s>
It	O
was	O
inspired	O
by	O
and	O
provides	O
much	O
of	O
the	O
features	O
of	O
the	O
Apache	O
Log4j	B-Application
project	O
.	O
</s>
<s>
A	O
zero-day	O
vulnerability	O
involving	O
remote	O
code	O
execution	O
in	O
Log4j	B-Application
2	O
,	O
given	O
the	O
descriptor	O
"	O
Log4Shell	O
"	O
(	O
CVE-2021-44228	O
)	O
,	O
was	O
found	O
and	O
reported	O
to	O
Apache	O
by	O
Alibaba	O
on	O
November	O
24	O
,	O
2021	O
,	O
and	O
published	O
in	O
a	O
tweet	B-Application
on	O
December	O
9	O
,	O
2021	O
.	O
</s>
<s>
Affected	O
services	O
include	O
Cloudflare	B-Application
,	O
iCloud	B-Application
,	O
Minecraft	B-Application
:	I-Application
Java	I-Application
Edition	I-Application
,	O
Steam	B-Application
,	O
Tencent	B-Operating_System
QQ	I-Operating_System
,	O
and	O
Twitter	B-Application
.	O
</s>
<s>
The	O
feature	O
causing	O
the	O
vulnerability	O
could	O
be	O
disabled	O
with	O
a	O
configuration	O
setting	O
,	O
which	O
had	O
been	O
removed	O
in	O
Log4j	B-Application
version	O
2.15.0-rc1	O
(	O
officially	O
released	O
on	O
December	O
6	O
,	O
2021	O
,	O
three	O
days	O
before	O
the	O
vulnerability	O
was	O
published	O
)	O
,	O
and	O
replaced	O
by	O
various	O
settings	O
restricting	O
remote	O
lookups	O
,	O
thereby	O
mitigating	O
the	O
vulnerability	O
.	O
</s>
<s>
For	O
additional	O
security	O
,	O
all	O
features	O
using	O
JNDI	B-Language
,	O
on	O
which	O
this	O
vulnerability	O
was	O
based	O
,	O
will	O
be	O
disabled	O
by	O
default	O
,	O
and	O
support	O
for	O
message	O
lookups	O
removed	O
from	O
version	O
2.16.0	O
onward	O
.	O
</s>
