We tried different ways:
1.
ByteArrayOutputStream out = new ByteArrayOutputStream();
RequestLogger logger = databaseClient.newLogger(out);
xmlDocumentManager.startLogging(logger);
try {
out.write("Test!".getBytes());
out.flush();
} catch (IOException e) {
e.printStackTrace();
}
DocumentDescriptor e = this.xmlDocumentManager.newDescriptor(this.getUri(id));
StringHandle content = (StringHandle)this.xmlDocumentManager.read(e,
(new StringHandle()).withFormat(Format.XML));
2.
ByteArrayOutputStream out = new ByteArrayOutputStream();
RequestLogger logger = databaseClient.newLogger(out);
xmlDocumentManager.startLogging(logger);
try {
logger.getPrintStream().write("Test".getBytes());
logger.getPrintStream().flush();
} catch (IOException e) {
e.printStackTrace();
}
DocumentDescriptor e = this.xmlDocumentManager.newDescriptor(this.getUri(id));
StringHandle content = (StringHandle)this.xmlDocumentManager.read(e,
(new StringHandle()).withFormat(Format.XML));
We also tried to call startLogging after the try catch block.
Once we've also tried to call append instead of write, but we never
found "Test" in the Logfiles.
Best regards
Andreas Holzgethan
*Andreas Holzgethan BSc. *
*IT Consultant *
EBCONT enterprise technologies GmbH
Millennium Tower
Handelskai 94-96
1200 Wien
Mobil: +43 664 606 517 05
Email:[email protected]
Web:http://www.ebcont-et.com/ <http://www.ebcont.com/>
<http://www.ebcont.com/>
OUR TEAM IS YOUR SUCCESS
HG St. Pölten - FN 293731 h
UID: ATU63444589
2017-05-18 18:40 GMT+02:00 Sam Mefford <[email protected]>:
> Can you please share the code you tried that did not work?
>
> Sam Mefford
> Senior Engineer
> MarkLogic Corporation
> [email protected]
> Cell: +1 801 706 9731 <(801)%20706-9731>
> www.marklogic.com
>
> This e-mail and any accompanying attachments are confidential. The
> information is intended solely for the use of the individual to whom it is
> addressed. Any review, disclosure, copying, distribution, or use of this
> e-mail communication by others is strictly prohibited. If you are not the
> intended recipient, please notify us immediately by returning this message
> to the sender and delete all copies. Thank you for your cooperation.
> ------------------------------
> *From:* [email protected] [
> [email protected]] on behalf of Andreas Felix [
> [email protected]]
> *Sent:* Thursday, May 18, 2017 4:57 AM
> *To:* [email protected]
> *Subject:* [MarkLogic Dev General] Logging Java Api
>
> Hi,
> is there a possibility to write own logging entries using the
> RequestLogger from the java api?
>
> In the documentation (see https://docs.marklogic.com/guide/java/logging)
> i found the info for writing own log entries but it does not work
>
> regards
> andreas
>
> --
>
> Mit freundlichen Grüßen / Kind regards
> *Ing. Andreas Felix*
> Senior IT Consultant
>
> *EBCONT enterprise technologies GmbH*
>
> Millennium Tower
> Handelskai 94-96
> 1200 Wien
>
> Mobil: +43 664 606 51 747
> Fax: +43 2772 812 69-9
> Email: *[email protected] <[email protected]>*
> Web: http://www.ebcont-et.com/
>
> *OUR TEAM IS YOUR SUCCESS*
>
> HG St. Pölten - FN 293731h
> UID: ATU63444589
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>
_______________________________________________
General mailing list
[email protected]
Manage your subscription at:
http://developer.marklogic.com/mailman/listinfo/general