I want to print only particular package from the exception stackTrace. How to achieve this?
For example, consider the following stacktrace
com.mongodb.MongoInternalException: DBPort.findOne failed
at com.mongodb.DBPort.findOne(DBPort.java:153)
at com.mongodb.DBPort.runCommand(DBPort.java:159)
at com.mongodb.DBTCPConnector.testMaster(DBTCPConnector.java:371)
at com.myapp.foo.MongoConnection.java:10
at com.myapp.foo.MongoConnection.java:27
I want to print only the package "com.myapp.foo" in the stackTrace with linenumber and methodName
What about something like this:
You can of course add any custom package filtration you need.