How to capture logcat logs and print while testing with appium?

Thanks for response.
I read that before but don’t know how to implement.

I am using this method but i don’t find any data.

AppiumDriverLocalService service = new AppiumServiceBuilder()
				.withIPAddress("")
				.usingAnyFreePort()
				.usingDriverExecutable(new File(""))
				.withAppiumJS(new File(""))
				.withLogFile(new File("")) <<<-------------------This will do the trick
				.build();