View Single Post
Old 04-30-2012, 10:01 AM   #8
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
The O.P. deals with changing the configuration of the log rotation utility.
I.E: What, when, how to deal with the log files as they accumulate on the machine.

The configuration file for the system logger can be found in the: /etc/syslog-ng/syslog-ng.conf file.

No mysteries there, on a Linux machine (or ask Google this) man syslog-ng.conf will describe the configureation file contents for your study.
as in: http://linux.die.net/man/5/syslog-ng.conf

Quoting snippets of the K3 /etc/syslog-ng/syslog-ng.conf (an open source file) that apply to the O.P:
Note: the formating of these quotes got messed up because I used "quote" rather than "code" tags - so allow for that when reading these please.

The system logger has these sources of messages defined:
Quote:
source src { file("/proc/kmsg"); unix-stream("/dev/log"); internal(); };
source net { udp(); };
That is how the messages to be sorted/filtered/passed can get to the system logger.

The destinations of the O.P. are defined as:
Quote:
destination messages {
file("/var/log/messages"
template("$YEAR$MONTH$DAY:$HOUR$MIN$SEC $MSG\n")
template_escape(no)
);
};
destination odot {
file("/var/log/odotlite"
template("$YEAR$MONTH$DAY:$HOUR$MIN$SEC $MSG\n")
template_escape(no)
);
};
As seen in the first quote above, syslog-ng can be on the receiving end of network logging, also it can be on the sending end of network logging:
Quote:
#destination loghost { udp("loghost" port(999)); };
Which in the copy of the K3 syslog-ng.conf file I am quoting from is "deactivated" by the first character (making this a comment).

The system logger is responsible for filtering the messages, here are the filter quotes for the O.P. logging:
Quote:
filter f_odot { facility(local6) and match("DeviceMessaging"); };
filter f_msgs { not facility(local6); };
Finally, with all of those things defined, the "what to do with the messages" configuration lines:
Quote:
log { source(src); filter(f_odot); destination(odot); };
log { source(src); filter(f_msgs); destination(messages); };
If you now read this post from the bottom-up, you can see how messages are being handled in the stock K3 configuration.

This configuration file is 99% the file that is used in Debian/Linux - with a few changes by Amazon.

For your reading pleasure, they left the "stock" message filter in the file:
Quote:
filter f_messages { level(info..warn)
and not facility(auth, authpriv, mail, news); };
It is just not referenced, Amazon supplied the f_msgs filter instead.
But you will note that "sensitive" information is "normally" excluded from the /var/log/messages file in the "Debian stock" configuration file.

If you really don't want anything to be recorded, changing the destination description to: file("/dev/null" ... would be the "big hammer" way of doing that.

Of course, you can be much more selective than that about how log messages are handled (RTFM).

BIG NOTE:
This only controls messages that are handled by the system logger. This does not prevent an application from sending information "off-Kindle" by some other (more direct) means.

Blocking those paths using the firewall of either the Kindle or your own Router has been already covered in other threads here.

EDIT
The O.P. subject of the "log rotate" utility is more general than just the system logging files. The "log rotate" utility can be configured to handle any file that accumulates over time, not just the system logging file(s).

Last edited by knc1; 04-30-2012 at 10:51 AM. Reason: typo
knc1 is offline   Reply With Quote