RPS gems and logging

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

RPS gems and logging

GLASS mailing list
Hi there,

I have a question regarding logging in the scenario where you have an
RPC gem which is started by netldi on a node where the target stone
resides. Assume also possibly more than one different stone running here.

I'd like to control where the RPC gem would log. Now, AFAIK, you can do
this from the connecting client's side by changing the NRS, but I don't
want clients to have to know this. So the other way to do this is by
setting GEMSTONE_NRS_ALL=#dir:/some/where but the problem with this is
that GEMSTONE_NRS_ALL applies to all stones started by the single netldi
in whose environment you set the variable.

I want to log everything to do with a specific stone (including the gems
started for it) in one place.

The docs say: "If you set GEMSTONE_NRS_ALL before starting a Stone, an
application, or a utility (such as copydbf), that setting applies only
to your own processes and does not affect other users.
"

...so I have tried setting it when running startstone for that
particular stone only (NOT for startnetldi) - yet it seems to be ignored
(which makes sense since the stone is not the thing starting up the gem).

The other way I can think of doing this is to have my own modified
scripts in $GEMSTONE/sys that set GEMSTONE_NRS_ALL based on the stone
you want to connect to, but that feels like reinventing the wheel.

Is there any way to achieve what I want to do without involving the
connecting client's NRS or starting differently named netldi's or
changing the standard sys/ scripts?


Reards
Iwan
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
Hi Iwan,

Not strictly related, but as I know you are using Seaside etc, I ask: do you gems really need to be RPC? Why can't the be linked? 
In the past, i have some issues with logs with RPC gems because they would "disappear" when the gem is shutdown. With linked gems I don't have that problem.

I am defining those logs like this:

## NRS_ALL to define log directory for all processes
GEMSTONE_NRS_ALL='#dir:$GEMSTONE_LOGDIR#log:%N%P.log'

And I do rune > 1 stone in the same machine and I am not finding the issue you comment. I mean, all my logs are self contained per stone under $GS_HOME/server/stones/XXX/logs.

Cheers,



On Sun, Nov 5, 2017 at 3:50 AM, Iwan Vosloo via Glass <[hidden email]> wrote:
Hi there,

I have a question regarding logging in the scenario where you have an RPC gem which is started by netldi on a node where the target stone resides. Assume also possibly more than one different stone running here.

I'd like to control where the RPC gem would log. Now, AFAIK, you can do this from the connecting client's side by changing the NRS, but I don't want clients to have to know this. So the other way to do this is by setting GEMSTONE_NRS_ALL=#dir:/some/where but the problem with this is that GEMSTONE_NRS_ALL applies to all stones started by the single netldi in whose environment you set the variable.

I want to log everything to do with a specific stone (including the gems started for it) in one place.

The docs say: "If you set GEMSTONE_NRS_ALL before starting a Stone, an application, or a utility (such as copydbf), that setting applies only to your own processes and does not affect other users.
"

...so I have tried setting it when running startstone for that particular stone only (NOT for startnetldi) - yet it seems to be ignored (which makes sense since the stone is not the thing starting up the gem).

The other way I can think of doing this is to have my own modified scripts in $GEMSTONE/sys that set GEMSTONE_NRS_ALL based on the stone you want to connect to, but that feels like reinventing the wheel.

Is there any way to achieve what I want to do without involving the connecting client's NRS or starting differently named netldi's or changing the standard sys/ scripts?


Reards
Iwan
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass



--

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
In reply to this post by GLASS mailing list
Iwan,

Which version of GemStone are you using? ... the exact details about
where logs go has changed over time as we've fixed bugs and
functionality, so in order to give you a good answer we need to know
which version of GemStone you are using ...

Dale


On 11/4/17 11:50 PM, Iwan Vosloo via Glass wrote:

> Hi there,
>
> I have a question regarding logging in the scenario where you have an
> RPC gem which is started by netldi on a node where the target stone
> resides. Assume also possibly more than one different stone running here.
>
> I'd like to control where the RPC gem would log. Now, AFAIK, you can
> do this from the connecting client's side by changing the NRS, but I
> don't want clients to have to know this. So the other way to do this
> is by setting GEMSTONE_NRS_ALL=#dir:/some/where but the problem with
> this is that GEMSTONE_NRS_ALL applies to all stones started by the
> single netldi in whose environment you set the variable.
>
> I want to log everything to do with a specific stone (including the
> gems started for it) in one place.
>
> The docs say: "If you set GEMSTONE_NRS_ALL before starting a Stone, an
> application, or a utility (such as copydbf), that setting applies only
> to your own processes and does not affect other users.
> "
>
> ...so I have tried setting it when running startstone for that
> particular stone only (NOT for startnetldi) - yet it seems to be
> ignored (which makes sense since the stone is not the thing starting
> up the gem).
>
> The other way I can think of doing this is to have my own modified
> scripts in $GEMSTONE/sys that set GEMSTONE_NRS_ALL based on the stone
> you want to connect to, but that feels like reinventing the wheel.
>
> Is there any way to achieve what I want to do without involving the
> connecting client's NRS or starting differently named netldi's or
> changing the standard sys/ scripts?
>
>
> Reards
> Iwan
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Mariano,

On 07/11/2017 13:47, Mariano Martinez Peck wrote:
> Not strictly related, but as I know you are using Seaside etc, I ask: do
> you gems really need to be RPC? Why can't the be linked?

This is actually a bit of a side project which involves using gembuilder
for C. If you use its "thread-safe API", it forces you to go via RPC. (I
guess this is so several different RPC gems can be started, each running
its own single thread on the server.) It is a "developing experiment"
though ;-) and that may have been the wrong choice of API.

> In the past, i have some issues with logs with RPC gems because they
> would "disappear" when the gem is shutdown. With linked gems I don't
> have that problem.

Good to know, thanks.


> I am defining those logs like this:
>
> ## NRS_ALL to define log directory for all processes
> GEMSTONE_NRS_ALL='#dir:$GEMSTONE_LOGDIR#log:%N%P.log'
>
> And I do rune > 1 stone in the same machine and I am not finding the
> issue you comment. I mean, all my logs are self contained per stone
> under $GS_HOME/server/stones/XXX/logs.

Thanks. I have been doing this with a bare-bones gemstone install, not
gsdevkit or the shipped stuff in $GEMSTONE/seaside. AFAIK
$GEMSTONE_LOGDIR is a gsdevkit thing? I will go investigate.

Iwan


_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Dale,


On 07/11/2017 16:29, Dale Henrichs via Glass wrote:
> Which version of GemStone are you using? ... the exact details about
> where logs go has changed over time as we've fixed bugs and
> functionality, so in order to give you a good answer we need to know
> which version of GemStone you are using ...


Sorry, I should have said. This is on 3.3.3 but I am thinking of moving
it to 3.4.

Thanks
Iwan

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
In reply to this post by GLASS mailing list
Iwan,

I guess you have two questions and I can answer the first one and take a
stab at the second...

First question, RPC gems inherit the environment variable from the
netldi, so any env vars you want the RPC gem to see need to be set
before starting the netldi. If you are running a linked gem (i.e.,
topaz) the environment variables are inherited from the process starting
topaz.

The second question (log everything in one spot) is why I asked the
version question, because I seem to recall that there are cases where
not all logs got handled correctly, but as I think about it the problem
areas may have been relatively special cases and/or version specific
bugs. I'll wait until you get the basic logging working with
GEMSTONE_NRS_ALL before digging deeper.

As shameless a plug for using GsDevKit_home, you can set custom env vars
in a per stone custom_stone.env. As Mariano mentions GEMSTONE_LOGDIR
defines the log location and here is the NRS expression used:

   GEMSTONE_NRS_ALL='#dir:$GEMSTONE_LOGDIR#log:%N%P.log'

The custom_stone.env script is executed before starting your netldi,
when using startNetldi and before starting a topaz session when using
startTopaz. You can use GsDevKit_home without having to use tODE or
extent0.seaside.dbf. Currently to create a stone that uses extent0.dbf
you would do the following:

   createStone -g -s
$GS_HOME/shared/downloads/product/GemStone64Bit3.3.3-i386.Linux/product/bin/extent0.dbf
gs_333 3.3.3

I've got a release in the "oven" that simplifies the creation process:

   createStone -G gs_329 3.2.9

Dale

On 11/4/17 11:50 PM, Iwan Vosloo via Glass wrote:

> Hi there,
>
> I have a question regarding logging in the scenario where you have an
> RPC gem which is started by netldi on a node where the target stone
> resides. Assume also possibly more than one different stone running here.
>
> I'd like to control where the RPC gem would log. Now, AFAIK, you can
> do this from the connecting client's side by changing the NRS, but I
> don't want clients to have to know this. So the other way to do this
> is by setting GEMSTONE_NRS_ALL=#dir:/some/where but the problem with
> this is that GEMSTONE_NRS_ALL applies to all stones started by the
> single netldi in whose environment you set the variable.
>
> I want to log everything to do with a specific stone (including the
> gems started for it) in one place.
>
> The docs say: "If you set GEMSTONE_NRS_ALL before starting a Stone, an
> application, or a utility (such as copydbf), that setting applies only
> to your own processes and does not affect other users.
> "
>
> ...so I have tried setting it when running startstone for that
> particular stone only (NOT for startnetldi) - yet it seems to be
> ignored (which makes sense since the stone is not the thing starting
> up the gem).
>
> The other way I can think of doing this is to have my own modified
> scripts in $GEMSTONE/sys that set GEMSTONE_NRS_ALL based on the stone
> you want to connect to, but that feels like reinventing the wheel.
>
> Is there any way to achieve what I want to do without involving the
> connecting client's NRS or starting differently named netldi's or
> changing the standard sys/ scripts?
>
>
> Reards
> Iwan
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
Hi Dale,

On 07/11/2017 18:26, Dale Henrichs via Glass wrote:
> First question, RPC gems inherit the environment variable from the
> netldi, so any env vars you want the RPC gem to see need to be set
> before starting the netldi.

Thanks for confirming, that is how I understood it...

> The second question (log everything in one spot) is why I asked the
> version question, because I seem to recall that there are cases where
> not all logs got handled correctly, but as I think about it the problem
> areas may have been relatively special cases and/or version specific
> bugs. I'll wait until you get the basic logging working with
> GEMSTONE_NRS_ALL before digging deeper.
>
> As shameless a plug for using GsDevKit_home, you can set custom env vars
> in a per stone custom_stone.env. As Mariano mentions GEMSTONE_LOGDIR
> defines the log location and here is the NRS expression used:
>
>    GEMSTONE_NRS_ALL='#dir:$GEMSTONE_LOGDIR#log:%N%P.log'
>
> The custom_stone.env script is executed before starting your netldi,
> when using startNetldi and before starting a topaz session when using
> startTopaz.

How does this work? Is $GEMSTONE_LOGDIR is then set in the netldi
environment based on your previous answer? Because in that case it will
be the same for all RCP gems started per netldi... or does GsDevKit_home
start a separate netldi per stone?

Thanks
Iwan

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list

On Tue, Nov 7, 2017 at 2:38 PM, Iwan Vosloo via Glass <[hidden email]> wrote:
Hi Dale,

On 07/11/2017 18:26, Dale Henrichs via Glass wrote:
First question, RPC gems inherit the environment variable from the netldi, so any env vars you want the RPC gem to see need to be set before starting the netldi.

Thanks for confirming, that is how I understood it...

The second question (log everything in one spot) is why I asked the version question, because I seem to recall that there are cases where not all logs got handled correctly, but as I think about it the problem areas may have been relatively special cases and/or version specific bugs. I'll wait until you get the basic logging working with GEMSTONE_NRS_ALL before digging deeper.

As shameless a plug for using GsDevKit_home, you can set custom env vars in a per stone custom_stone.env. As Mariano mentions GEMSTONE_LOGDIR defines the log location and here is the NRS expression used:

   GEMSTONE_NRS_ALL='#dir:$GEMSTONE_LOGDIR#log:%N%P.log'

The custom_stone.env script is executed before starting your netldi, when using startNetldi and before starting a topaz session when using startTopaz.

How does this work? Is $GEMSTONE_LOGDIR is then set in the netldi environment based on your previous answer? Because in that case it will be the same for all RCP gems started per netldi... or does GsDevKit_home start a separate netldi per stone?


The latter :)





_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: RPS gems and logging

GLASS mailing list
On 07/11/2017 19:51, Mariano Martinez Peck wrote:

>
> On Tue, Nov 7, 2017 at 2:38 PM, Iwan Vosloo via Glass
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>     How does this work? Is $GEMSTONE_LOGDIR is then set in the netldi
>     environment based on your previous answer? Because in that case it
>     will be the same for all RCP gems started per netldi... or does
>     GsDevKit_home start a separate netldi per stone?
>
>
> The latter :)

Ahh, thanks. I did start looking at the GsDevKit code and thought that
must be what it does, but have not dug quite deep enough to be totally
convinced.

Iwan
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass