Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Is it possible to get stdout from GSC?

We are working with 3rd party library within our PU's. It has a nasty feature of writing important information about internal failures into stdout only. Is it possible to log stdout from GSC's somewhere like GSA to be able to debug problems like that?

asked 2014-10-06 12:29:20 -0600

aliher1911 gravatar image

updated 2014-10-06 13:22:25 -0600

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

Hi, In version 10.1 we are changing the logging framework. Meanwhile, you can write your own handler (see more information here: http://docs.gigaspaces.com/xap97adm/l... ) For production readiness, i suggest you open a support case, to have the support team review your solution. Thanks, Inbar

answered 2014-10-14 03:59:35 -0600

inbarc gravatar image
edit flag offensive delete link more

If I had that problem, I might do something like this:

Write a debug-scoped Spring Bean declared in my context descriptor that does the following:

public class DebugScopedBean{

       private StdOutToJavaUtilLoggingAdaptor adaptor;
       private OutputStream original = System.out;

       public void init(){

       public void destroy(){


@Component class StdOutToJavaUtilLoggingAdaptor extends OutputStream{

       private static final char ENDLINE = ...
       private final StringBuffer buff = new StringBuffer();
       private final Logger destinationLogger = ...

       public void write(char c){
          if( c == ENDLINE ){
              buff = new StringBuffer(); // or whatever, depending upon threadyness
          else buff.append(c);


Please understand that this is not a suggestion for production code and may have unintended side-effects in other test code if your tests are not managed and terminated appropriately. But it should work.

answered 2014-10-07 08:39:56 -0600

jasonnerothin gravatar image
edit flag offensive delete link more


I need a production quality solution, not a test one. Gigaspace itself overrides system out to capture outofmemory errors. If we remove that stdout then we may loose capability of autorestart on OOM. So it will require deploying something on every gsc which is not directly supported.

aliher1911 gravatar image aliher1911  ( 2014-10-13 09:50:22 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2014-10-06 12:29:20 -0600

Seen: 171 times

Last updated: Oct 14 '14