<s>
In	O
information	B-General_Concept
technology	I-General_Concept
,	O
log	B-Application
rotation	I-Application
is	O
an	O
automated	O
process	B-Operating_System
used	O
in	O
system	B-Application
administration	I-Application
in	O
which	O
log	B-Application
files	I-Application
are	O
compressed	B-General_Concept
,	O
moved	O
(	O
archived	O
)	O
,	O
renamed	O
or	O
deleted	O
once	O
they	O
are	O
too	O
old	O
or	O
too	O
big	O
(	O
there	O
can	O
be	O
other	O
metrics	O
that	O
can	O
apply	O
here	O
)	O
.	O
</s>
<s>
The	O
main	O
purpose	O
of	O
log	B-Application
rotation	I-Application
is	O
to	O
restrict	O
the	O
volume	O
of	O
the	O
log	O
data	O
to	O
avoid	O
overflowing	O
the	O
record	O
store	O
,	O
while	O
keeping	O
the	O
log	B-Application
files	I-Application
small	O
enough	O
so	O
viewers	O
can	O
still	O
open	O
them	O
.	O
</s>
<s>
Servers	O
which	O
run	O
large	O
applications	O
,	O
such	O
as	O
LAMP	B-Application
stacks	I-Application
,	O
often	O
log	O
every	O
request	O
:	O
in	O
the	O
face	O
of	O
bulky	O
logs	O
,	O
log	B-Application
rotation	I-Application
provides	O
a	O
way	O
to	O
limit	O
the	O
total	O
size	O
of	O
the	O
logs	O
retained	O
while	O
still	O
allowing	O
analysis	O
of	O
recent	O
events	O
.	O
</s>
<s>
Even	O
though	O
some	O
arguments	O
in	O
favor	O
of	O
log	B-Application
rotation	I-Application
imply	O
that	O
maintaining	O
smaller	O
files	O
increases	O
writing	O
performance	O
,	O
the	O
size	O
of	O
a	O
file	O
does	O
n’t	O
affect	O
its	O
writing	O
performance	O
.	O
</s>
<s>
In	O
Linux	B-Application
log	B-Application
rotation	I-Application
is	O
typically	O
performed	O
using	O
the	O
logrotate	B-Application
command	B-Application
.	O
</s>
<s>
The	O
command	B-Application
can	O
be	O
used	O
to	O
email	O
logs	O
to	O
a	O
systems	B-Application
administrator	I-Application
after	O
log	B-Application
rotation	I-Application
.	O
</s>
<s>
Dated	O
logs	O
may	O
also	O
be	O
compressed	B-General_Concept
.	O
</s>
<s>
In	O
FreeBSD	B-Operating_System
and	O
macOS	B-Application
the	O
newsyslog	O
command	B-Application
is	O
used	O
.	O
</s>
<s>
It	O
can	O
compress	O
the	O
archives	O
and	O
send	O
a	O
signal	B-General_Concept
to	O
a	O
process	B-Operating_System
to	O
reset	O
logging	B-Application
.	O
</s>
<s>
The	O
command	B-Application
is	O
often	O
run	O
as	O
a	O
cron	B-General_Concept
job	I-General_Concept
,	O
which	O
has	O
the	O
effect	O
of	O
fully	O
automatic	O
log	B-Application
rotation	I-Application
.	O
</s>
<s>
Typically	O
,	O
a	O
new	O
logfile	B-Application
is	O
created	O
periodically	O
,	O
and	O
the	O
old	O
logfile	B-Application
is	O
renamed	O
by	O
appending	O
a	O
"	O
1	O
"	O
to	O
the	O
name	O
.	O
</s>
<s>
Each	O
time	O
a	O
new	O
log	B-Application
file	I-Application
is	O
started	O
,	O
the	O
numbers	O
in	O
the	O
file	O
names	O
of	O
old	O
logfiles	B-Application
are	O
increased	O
by	O
one	O
,	O
so	O
the	O
files	O
"	O
rotate	O
"	O
through	O
the	O
numbers	O
(	O
thus	O
the	O
name	O
"	O
log	B-Application
rotation	I-Application
"	O
)	O
.	O
</s>
<s>
Old	O
logfiles	B-Application
whose	O
number	O
exceeds	O
a	O
threshold	O
can	O
then	O
be	O
deleted	O
or	O
archived	O
off-line	O
to	O
save	O
space	O
.	O
</s>
