Android Logcat Rotation Size and Number Of Rotation Parameters
Asked Answered
C

2

12

Hi Android Developers!

I am trying to figure out what -r and -n parameters for logcat utilitiy mean. When my log file exceeds -r number of kilobytes in size; it deletes the whole content of my log file which leaves it empty or creates a new file to continue with the logging process? What exactly does -n mean as well, ofc?

Thanks for your replies in advance, Ilker

Carlycarlye answered 26/1, 2013 at 17:25 Comment(0)
P
2

-n specifies the maximum number of rotated logs
-r specifies the size after which the log file should rotate

See http://developer.android.com/tools/debugging/debugging-log.html for more info.

Puck answered 9/9, 2013 at 8:42 Comment(2)
What's the -r limit? Apparently it's > the default (16) and less than what I'm specifying (10000). Clearly I can use binary search to determine it myself, but a doc that contains this would probably be useful to know about (haven't found it yet). Note that I use -r and -n, and it works for me. I invoke logCat from my Android app. A useful reference for the code is this Question: #6219845Nautical
Can you write a command to save logact contents into a file including -r and -n paramaters.Italianate
Q
5

enter image description here

Source

So after a file size reaches the limit specified using -r option then new file is created and logs are redirected to that file. Number of such files to be created are specified by -n option. When n count is reached your 1st file will be overwritten.

Quaver answered 4/2, 2015 at 18:29 Comment(0)
P
2

-n specifies the maximum number of rotated logs
-r specifies the size after which the log file should rotate

See http://developer.android.com/tools/debugging/debugging-log.html for more info.

Puck answered 9/9, 2013 at 8:42 Comment(2)
What's the -r limit? Apparently it's > the default (16) and less than what I'm specifying (10000). Clearly I can use binary search to determine it myself, but a doc that contains this would probably be useful to know about (haven't found it yet). Note that I use -r and -n, and it works for me. I invoke logCat from my Android app. A useful reference for the code is this Question: #6219845Nautical
Can you write a command to save logact contents into a file including -r and -n paramaters.Italianate

© 2022 - 2024 — McMap. All rights reserved.