axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
Subject AW: AW: [AXIS2C] how to set logging to stderr?
Date Wed, 16 Jan 2008 13:12:27 GMT
Hi all, and thank you all, you answered my question, 

	axis_log = axutil_log_create(allocator, NULL, stdout);

does the trick for me on a Windows 2000 system with VS2005. Without 
sdtout in the parameter list, but NULL, the log would be axis2.log, 
but with stdout instead of NULL, the log goes to the screen. Dont know
why but it works.

I just enterd stdout as 3th parameter, and was expecting that I get 
a compiler error message, something like sdtout is not  declared ..

but sttdout is defined as

#define stdout (&__iob_func()[1])

in stdio.h

So to my surprise VC2005 was happy and when I run my code I get all 
the log records on a standard screen like any prinf() statement does.

But anyway, thank for your help. I got a lot very helpfull stuff now
and will consider it when I do the final designe step for myserver.


Regards
Josef.Stadelmann@
axa-winterthur.ch


-----Urspr√ľngliche Nachricht-----
Von: Senaka Fernando [mailto:senaka@wso2.com]
Gesendet: Mittwoch, 16. Januar 2008 11:43
An: Apache AXIS C User List
Betreff: Re: AW: [AXIS2C] how to set logging to stderr?


Hi Dinesh, and Josef

Hi this is a cheap solution, to set permissions etc. The better way is
this. As you see, in Linux, the std-streams are mapped to files. If you
write to those files they will be written to the respective streams
irrespective of what and how you write.

You can't prioritize redirects to specific locations. That means it is
impossible to write error messages to one and debug messages to another
according to the current implementation. However, you should be able to
write to several locations with priorities if you build yourself a little
extension. This is the process.

1. You'll have to figure out how to write to stdout. That means you have
to write to that file that maps to the stdout stream.
2. You will run your axis_based_executable inside another.
3. Read more on how you could use fork and exec to create background
processes so that you can run one application inside another.
4. You outer application will barely listen to the stdout stream.
5. Then it is upto your outer application to do the logging.
6. Identification of error/debug etc messages can be done using a regular
expression parsing mechanism.

Startup Workflow:

A - outer_client
B - inner_axis_based_client

1. run A
2. A runs B (background)
3. B writes logs to stdout
4. A listens to stdout
5. A writes to log_file, stderror etc.

Exit Workflow:

A - outer_client
B - inner_axis_based_client

1. A catches Ctrl+C
2. A kills B
3. A exits


I know that this is so complicated but I don't see any better way.

Regards,
Senaka

> Hi,
>
> "Stadelmann Josef" <josef.stadelmann@axa-winterthur.ch> writes:
>
>> Thanks, but as I do not use axis2 simple server ...
>> I am jsut using the axiom libs and libs forming the base
>> such as axutil and libxml2 etc.
>>
>> What do I use to redirect output in code?
>>     axis_log = axutil_log_create(allocator, NULL, NULL);
>> this creates an axis2.log under . directory
>
> AFAIK , there is a no such a way to redirect out put to stdout or
> stderr.  However I could say you a small workaround for this. Try to
> assign a log file which doesn't have write permission.
>
> For example, if your logs written into echo.log, set it's file
> permission to 333 (or 000).
>
> $chmod 000 axis2.log (this is not recommended though)
>
> It will redirect output to stderr then, and please raise a jira issue
> for this.
>
> thanks,
> Dinesh
> --
> http://nethu.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-c-user-help@ws.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-c-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-user-help@ws.apache.org


Mime
View raw message