Android studio maximum number of lines logcat

29,455

Solution 1

I found this:

I’ve found that in the eighth release of idea IDE, the “Limit Run/Debug Console Output” setting is gone so actually the only way for increasing the console output size is to set the idea.cycle.buffer.size value in idea.properties.

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.

enter image description here

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 
Share:
29,455

Related videos on Youtube

Aster
Author by

Aster

Updated on March 15, 2022

Comments

  • Aster
    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
    Aster over 9 years
    I 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.txt code
  • Aster
    Aster over 9 years
    Where do I find this idea.cycle.buffer.size value in Android Studio?
  • zzy
    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
    Aster over 9 years
    When 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
    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
    Aster over 9 years
    Well, 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
    zzy over 9 years
    Tools for coding are often weird, I can only find this way, good luck.
  • yvolk
    yvolk over 8 years
    This worked for me today with Android Studio v.1.3.1 I set: idea.cycle.buffer.size=50000
  • Error
    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
    zzy over 8 years
    @Error Have you tired restart your AS?
  • Error
    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
    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
    Error over 8 years
    @zzy how give AS 4G memory ?
  • zzy
    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
    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
    zzy over 8 years
    @Error I mean idea.exe.vmoptions is filename.
  • Amir Uval
    Amir Uval about 8 years
    This variable is no longer available in Android Studio 2.0 idea.properties
  • zzy
    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
    BobbyMick almost 7 years
    As 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
    Beezer almost 6 years
    this does not increase the per log.i(...) output length. It remains the same length, and is truncated in my case.
  • doctorram
    doctorram almost 3 years
    After more than 4 years, still "logcat" has not been added.
  • JDenais
    JDenais over 2 years
    Google have now assigned this issue to a developer. It should be implemented soon, and I'll update this answer when it is. -> lol