Appium logcat buffer size only fixed to 1.8MB

I use this way to get the logcat that is recorded using the Appium’s process

 List<LogEntry> logEntries = driver.manage().logs().get("logcat").getAll();

I can observe that the maximum logcat size I could get from the Appium is around 1.8MB

I have tried to increase the logcat buffer size by using this adb command

adb logcat -G 10MB

This is the output

I can get more than 2MB of logcat if I use adb logcat manually, but the Appium could not generate a logcat that exceeds 2MB.
This is my driver initialization

Appium version: 2.11.3
Uiautomator2 driver version: [email protected]

Please help on this, your help is really appreciated.

the maximum amount of log lines in the internal buffer is limited (AFAIK by 10k).
Consider log streaming as a possible workaround.
You may utilize GitHub - appium/appium-uiautomator2-driver: Appium driver for Android UIAutomator2 or appium-uiautomator2-driver/docs/bidi.md at master · appium/appium-uiautomator2-driver · GitHub for this purpose

Thank you for the suggestion on this, one question is that will this log streaming with the LogClient class process override the existing logcat in Appium?

Or create another thread to initiate this logcat thing by executing the driver.executeScript(“mobile:startLogsBroadcast”);

Sorry, I don’t understand the question.

If you are looking for an example then check java-client/src/test/java/io/appium/java_client/android/AndroidLogcatListenerTest.java at f185039f9f75e86e041320324e314b9f1b655d71 · appium/java-client · GitHub