Results 1 to 10 of 27

Hybrid View

  1. #1
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    I have used only remote adapter to subscribe items. Now I need to store the remote adapter file if anything exception happened need to be store into server log.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Sorry, this is not supported by Lightstreamer directly.
    Our policy is that the log file generated by the Server is only owned by the Server and should not be concurrently accessed by other processes, like Remote Adapters.
    The Adapter log should be inspected separately (or it may be manually merged with the Server log, but only when the log file is no longer used by the Server).

    Since the configuration of the log appenders is free and it is only subject to logback capabilities, you may configure the Server log appenders and the Remote Adapter log in such a way that they are merged in the same file.
    But I am not familiar with these techniques.
    On the other hand, if you really want to share the same log configuration and the same log interface (via slf4j) used by the Server, you can do that with a fake in-process Adapter; we can expand on this if needed. But you have to send the log from the Remote Adapter to the fake adapter yourself in some way.

  3. #3
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    I don't need to save logs in same file. I need to save in any of the file to check the issue. Please help me to store my remote adapter log in any of the file. My adapter is written in java.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Sorry for the misunderstanding.
    If you use Lightstreamer SDK for Java Remote Adapters, the SDK library produces some log and there are instructions on how to configure the verbosity and the log file.
    You can find the relevant information in the javadocs for SDK version 1.3.1
    https://lightstreamer.com/docs/ls-se...nce/index.html
    (see setLoggerProvider)

    I'm not sure that this is what you expected.
    If you want a facility to write to a file the log produced by your code, this is not provided, but it is the other way round.
    In fact, the library doesn't provide a log implementation, but requires that the hosting program provides such implementation for its own log.
    In this way, the hosting program can implement a bridge to send the log produced by the library to this implementation.

    We show the full process in the examples. See this one.
    Look in particular for the custom OutPrintLog class and its uses. Unfortunately, the example is simple and just sends the log to the standard output. To send the log to an implementation like log4j, more custom code is needed.

    Please be aware that this matter has undergone a few changes in the latest 1.4.0 version of the SDK, hence, when you upgrade the SDK, a small code change will be needed.

  5. #5
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    Exception in thread "Timer-0" com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 12 at com.google.gson.internal.bind.ReflectiveTypeAdapte rFactory$Adapter.read(ReflectiveTypeAdapterFactory .java:176) at com.google.gson.internal.bind.TypeAdapterRuntimeTy peWrapper.read(Type AdapterRuntimeTypeWrapper.java:40) at com.google.gson.internal.bind.ArrayTypeAdapter.rea d(ArrayTypeAdapter.java:72)at com.google.gson.Gson.fromJson(Gson.java:795)
    at com.google.gson.Gson.fromJson(Gson.java:761)
    at com.google.gson.Gson.fromJson(Gson.java:710)
    at com.google.gson.Gson.fromJson(Gson.java:682)at stocklist.feed_simulator.ExternalFeedSimulator.get JSON(ExternalFeedSimulator.java:98)at stocklist.feed_simulator.ExternalFeedSimulator$1.r un(ExternalFeedSimulator.java:170) at java.base/java.util.TimerThread.mainLoop(Timer.java:556) at java.base/java.util.TimerThread.run(Timer.java:506)
    Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 12 at com.google.gson.stream.JsonReader.expect(JsonReade r.java:339) at com.google.gson.stream.JsonReader.beginObject(Json Reader.java:322)

    I had checked on this and getting this error on screen. When I happened this exception getting stop the LS and adapter.




  6. #6
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    1,091
    Hello,
    So your suspect that the problem was in the Adapter is correct.
    I confirm that the error does not occur in Lightstreamer library code, but in custom code.
    Note that, even though you have kept the "ExternalFeedSimulator" class name that we use in our StockListDemo example, the getJSON method reported in the stack trace is not part of the original demo code, as well as the inclusion of the third-party com.google.gson library.
    So we have no clue on this error.

  7. #7
    Power Member
    Join Date
    Sep 2013
    Location
    Coimbatore
    Posts
    121
    Hello,
    I have checked well, in my adapter some times exception only happening. I have handled the exception so there is no issue on that. And I have noticed in browser when rates gets stops. I can confirm LS server is working, adapter is not sending the updates. Please look on this below response of browser developer tool

    var myEnv = lsc;
    var phase = null;
    function setPhase(ph) {
    phase = ph;
    }


    var winPhase = {};
    function setWin(tbl, ph) {
    winPhase[tbl] = ph;
    }


    var clsd = false;
    function c(cod, ph, tbl, its, flds, key, com) {
    LS_window.LS_w(cod, ph, tbl, its, flds, key, com);
    }


    function error(cod, ph, tbl, msg) {
    if (tbl != null) {
    LS_window.LS_l(cod, ph, tbl, msg);
    } else {
    LS_window.LS_l(cod, phase, null, msg);
    }
    }


    function start(sID, addr, kaMs, reqLim, srv, ip) {
    LS_window.LS_e(1, phase, sID, addr, kaMs, reqLim, srv, ip);
    }


    function end(cause) {
    LS_window.LS_e(4, phase, cause);
    }


    function loop(holdMs) {
    LS_window.LS_e(2, phase, holdMs);
    }


    function retry() {
    LS_window.LS_e(3, phase);
    }


    function s0() {}


    function bw(maxBW) {
    LS_window.LS_e(5, phase, maxBW);
    }


    function y(secs) {
    LS_window.LS_s(phase, secs);
    }


    var unchangedSignal = {};
    unchangedSignal.length = -1;
    function convert(b, f) {
    var a, c, d = f, e = [];
    for(a = 0;a < b.length;a++) {
    if(a < f) {
    e[a] = b[a]
    } else {
    if(b[a].charAt) {
    b[a] == '$' ? e[d] = '' : b[a] == '#' ? e[d] = null : (c = b[a].charAt(0), e[d] = c == '$' || c == '#' ? b[a].substring(1) : b[a]), d++
    } else {
    for(c = 0;c < b[a];c++) {
    e[d] = unchangedSignal, d++
    }
    }
    }
    }
    return e;
    }
    function d(tbl) {
    try { LS_window.LS_u(winPhase[tbl], convert(arguments || d.arguments, 2)); } catch(exc) {}
    }
    function z(tbl) {
    LS_window.LS_v(winPhase[tbl], convert(arguments || z.arguments, 2));
    }
    function n(tbl) {
    LS_window.LS_n(winPhase[tbl], arguments || n.arguments);
    }
    function s(tbl) {
    LS_window.LS_s(winPhase[tbl], arguments || s.arguments);
    }
    function r(tbl) {
    LS_window.LS_o(winPhase[tbl], arguments || r.arguments);
    }
    function p() {
    LS_window.LS_u(phase, arguments || p.arguments);
    }
    myEnv.setPhase = setPhase;
    myEnv.setWin = setWin;
    myEnv.c = c;
    myEnv.error = error;
    myEnv.end = end;
    myEnv.start = start;
    myEnv.loop = loop;
    myEnv.retry = retry;
    myEnv.s0 = s0;
    myEnv.bw = bw;
    myEnv.y = y;
    myEnv.convert = convert;
    myEnv.d = d;
    myEnv.z = z;
    myEnv.n = n;
    myEnv.s = s;
    myEnv.r = r;
    myEnv.p = p;
    myEnv.LS_window = LS_window;


    // END OF HEADER


    setPhase(7703);
    start('Scd93873dea9808b9M6deT5148753', null, 5000, 50000);

 

 

Similar Threads

  1. Replies: 2
    Last Post: August 20th, 2015, 11:41 AM
  2. Replace Adapter without restart of Light Streamer service
    By Slavko Parezanin in forum Adapter SDKs
    Replies: 1
    Last Post: January 19th, 2015, 09:43 AM
  3. Replies: 5
    Last Post: August 20th, 2009, 10:38 AM
  4. Replies: 2
    Last Post: October 17th, 2008, 09:22 AM
  5. Hitting ESC stops streaming
    By Mone in forum Client SDKs
    Replies: 1
    Last Post: April 19th, 2007, 07:42 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:23 AM.