# Virtual Graph Connection and Logging

**URL:** <https://community.stardog.com/t/virtual-graph-connection-and-logging/2395>\
**Category:** Support\
**Created:** [April 24, 2020, 8:58pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395 "2020-04-24T20:58:42Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [April 24, 2020, 8:58pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/1 "2020-04-24T20:58:42Z")

</div>

Problem ... I am connecting to a flaky Postgres DB. Sometimes the connection is dropped.

I can run the same query in Studio or programmatically where sometimes I get results and sometimes I don't. According to stardog.log and the API return codes, all the queries are successful. But, really, they aren't.

Shouldn't Stardog catch this?

Andrea

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [April 24, 2020, 9:05pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/2 "2020-04-24T21:05:34Z")

</div>

In addition, I can access the Postgres DB using psql and get a query response.

So, somewhere along the way, Stardog is returning a successful query with no results.

Andrea

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [April 24, 2020, 9:11pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/3 "2020-04-24T21:11:55Z")

</div>

Lastly, if I close Stardog and Studio and restart everything .... then the virtual graphs seem to work.

But only for a few times before Studio white screens or the results turn back into successful queries with no results.

Andrea

---

<div class="post-metadata">

**Author:** ![PaulJackson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/pauljackson/32/243_2.png) [@PaulJackson](https://community.stardog.com/u/PaulJackson)\
**Post date:** [April 25, 2020, 3:26pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/4 "2020-04-25T15:26:46Z")

</div>

I don't understand how a query can return successfully (no error in the log) but also fail as you describe. Sometimes connections go stale while sitting in our connection pool, but that type of failure leads to errors in the log, so I'm not confident that's what's happening here.

Could you add this entry to your `server/dbms/log4j2.xml` file and restart and share the results, indicating which queries were successful and which failed?

```auto
                <Logger name="com.complexible.stardog.virtual" level="DEBUG" additivity="false">
                        <AppenderRef ref="stardogAppender"/>
                </Logger>

```

Thank you,  
-Paul

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [April 25, 2020, 10:31pm UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/5 "2020-04-25T22:31:44Z")

</div>

Will do!

BTW, this also happened to a colleague of mine. Exact same behavior using PyCharm -\> pystardog -\> same Postgres DB. Always indicates successful query.

---

<div class="post-metadata">

**Author:** ![arwesterinen](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/arwesterinen/32/40_2.png) [@arwesterinen](https://community.stardog.com/u/arwesterinen)\
**Post date:** [April 30, 2020, 2:49am UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/6 "2020-04-30T02:49:07Z")

</div>

I haven't forgotten to do this, but have been pretty consumed working other problems. It is still on my todo list for this week.

Andrea

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [May 14, 2020, 2:49am UTC](https://community.stardog.com/t/virtual-graph-connection-and-logging/2395/7 "2020-05-14T02:49:19Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
