Android studio maximum number of lines logcat
Solution 1
I found this:
Solution 2
I'd like to add an update to this question, in case anyone else is looking for a way to change this on or after March of 2017.
The latest version of Android Studio, version 2.3, now has an option to change the size of the cyclic logcat buffer in Settings/Preferences.
Go to Settings/Preferences > Editor > General > Console and enable the Override console cyclic buffer size (1024KB) option. Once you enable this setting, you can enter a value in kilobytes for the logcat buffer.
It would have been better if Google added the word "logcat" in there, because it can't be found with a search of the preferences unless you specifically enter "console" or "cyclic", etc.
Edit: Google have now assigned this issue to a developer. It should be implemented soon, and I'll update this answer when it is.
Edit 2: According to Google, they have now added a setting for logcat's buffer to Dolphin Canary 6 release, and the issue is now marked as fixed.
Solution 3
Like @zzy says... edit file: PATH_TO_ANDROID_STUDIO\bin\idea.properties
Here are properties you can customize in your own idea.properties file: http://tools.android.com/tech-docs/configuration
#--------------------------------------------------------------------- # This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb). # Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled #--------------------------------------------------------------------- idea.cycle.buffer.size=1024
Modify above value to 2048 or whatever you need.
Solution 4
Go to File -> Settings -> Editor -> General -> Console
and checked Override console cyclic buffer size and make it 20399 KB (It is actally the maximum value). Then finally Restart your IDE.
Solution 5
You could start the logcat in a terminal: developer.android.com/tools/help/adb.html#logcat
[adb] logcat [option] ... [filter-spec] ...
and pipe it to a txt file
win
PATH\TO\YOUR\ADB\ adb.exe logcat > log.txt
or
linux
PATH\TO\YOUR\ADB\ adb logcat| tee log.txt
Related videos on Youtube
Aster
Updated on March 15, 2022Comments
-
Aster about 2 years
I'm testing with a real device connected to Android Studio. Because of multithreading behavior that I don't want to interrupt I've added lots of log statements to my code to find out what's happening. In logcat I see the statements comming, so far so good.
After running my complete test I found out that the beginning of my logging is missing! Seems to me that Android Studio deletes the earliest lines of logging when the log is in danger of growing too big. Since I would like to retrieve my whole logfile after a testrun (so I can do something else in the meantime), I would like to increase the number of lines Android Studio keeps.
Do you know where I can adjust this maximum number of lines logcat has to store? I hope/pray/assume that there is such a parameter, because I can't find it yet...
-
Aster over 9 yearsI would like to do this in Android Studio, not in command line. But still I tried to do this with the commandline, but I can't find out how to filter on my applications package name. I would expect this to do the trick, but it didn't:
code
[adb] logcat <package_name>:V > log.txtcode
-
Aster over 9 yearsWhere do I find this idea.cycle.buffer.size value in Android Studio?
-
zzy over 9 years@Aster Android Studio is based on idea IDE, so it's same to it. You can find it in
Android Studio\bin\idea.properties
-
Aster over 9 yearsWhen I try to edit this file it keeps complaining that it is open in another program, even when Android Studio is closed and none of the other programs seems to be touching the file. So until now I've not been able to test if changing this setting helps. Would be nice to be able to change this via Android Studio interface itself though, then I wouldn't have to bother with finding the file and the file lock thing.
-
zzy over 9 years@Aster Restart your computer and do not do anything , now to change the file , I don't think any other program will use this file and Android Studio won't run auto when OS started. And you have spent two weeks to bother with finding the interface , just use several minutes to find how to change a file that locked by other program, there are lots of tools can unlock it.
-
Aster over 9 yearsWell, I've been enjoying some vacation last two weeks. So luckily haven't bothered finding the interface for a couple of weeks. Had already thought of this solution with restarting my pc to remove the lock, but for now it was more important to keep working. The point I was trying to make is that it's a bit weird that I can't do this via the GUI.
-
zzy over 9 yearsTools for coding are often weird, I can only find this way, good luck.
-
yvolk over 8 yearsThis worked for me today with Android Studio v.1.3.1 I set: idea.cycle.buffer.size=50000
-
Error over 8 years@zzy i am using AndroidStudio 1.3.2 i tired idea.cycle.buffer.size=50000 also dea.cycle.buffer.size=disable .. but does not work for me is there another way ?
-
zzy over 8 years@Error Have you tired restart your AS?
-
Error over 8 years@zzy logcat in ddms sometimes scrolling and deleting logging when i tried to change buffer.size yes i restart AS and does not work , so i used Logcat in IDE with filter "show only selected application" and it works now logcat in ddms works fine but may clearing logging again
-
zzy over 8 years@Error It works for me, but I'm using 64bit version Intellij and gives it 4G memory. Maybe you should give AS more memory?
-
Error over 8 years@zzy how give AS 4G memory ?
-
zzy over 8 years@Error You can set Jvm args in idea.exe.vmoptions. -Xmx means the max memory you can give to it. The 64bit version is idea64.exe.vmoptions.
-
Error over 8 years@zzy sorry i searched for idea.exe.vmoptions in idea.properties text file but does not exist . where should it be ?
-
zzy over 8 years@Error I mean idea.exe.vmoptions is filename.
-
Amir Uval about 8 yearsThis variable is no longer available in Android Studio 2.0 idea.properties
-
zzy about 8 years@uval Then newest version of Android Studio is 1.5.1 according to developer.android.com/intl/zh-cn/tools/revisions/studio.html. Where could I find 2.0 ?
-
BobbyMick almost 7 yearsAs a side note, I've submitted a feature request to the Android Studio team to request that the logcat keyword brings up this setting when searching settings/preferences of the application. Add 'logcat' keyword into settings search
-
Beezer almost 6 yearsthis does not increase the per log.i(...) output length. It remains the same length, and is truncated in my case.
-
doctorram almost 3 yearsAfter more than 4 years, still "logcat" has not been added.
-
JDenais over 2 yearsGoogle have now assigned this issue to a developer. It should be implemented soon, and I'll update this answer when it is. -> lol