Thanks, working .

~Gurbeer
From: [email protected] 
[mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Wednesday, April 24, 2013 5:35 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Log File

Here is a way to get the last 5000 characters from a log by first asking for 
the size of the file, then taking a substring:

xquery version "1.0-ml";

let $length := xdmp:filesystem-file-length("c:/Program 
Files/MarkLogic/Data/Logs/ErrorLog.txt")
return
fn:substring-after(
  fn:substring(
   xdmp:filesystem-file("c:/Program Files/MarkLogic/Data/Logs/ErrorLog.txt"),
     $length - 5000, $length) ,
  "
")

-Danny


From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Singh, Gurbeer
Sent: Wednesday, April 24, 2013 2:26 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Log File

Thanks , below is the one I was looking for

Another question , how to shorten my Errorlog.txt

Currently they are so big (>500MB) I can't open them in browser.
That's why I was using tail command to read log
tail -n1500 /MarkLogic-Data/Logs/ErrorLog.txt > ~/prodmlerrors.txt

But now we don't have access to PROD box so below URL works but not readable, 
want to know how to spit my error log after a certain size. Can we do some 
setting change in ML so that it will create a new log after 50 MB.


~Gurbeer
From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Danny Sokolsky
Sent: Wednesday, April 24, 2013 5:01 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Log File

Have you tried looking at what the Admin Interface does on /error-logs.xqy ?

For example:

http://localhost:8001/error-logs.xqy

-Danny

From: 
[email protected]<mailto:[email protected]>
 [mailto:[email protected]] On Behalf Of Singh, Gurbeer
Sent: Wednesday, April 24, 2013 1:53 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] Log File

We have log file sitting under folder
/MarkLogic-Data/Logs/ErrorLog.txt

As per firm policy, developer has no access to PROD box. I was wondering if I 
can design a UI where I can see Error log files like this.


I want to write on XQY which will read above path and list all files in that 
folder

     5798                  Apr 24 09:32       11000_AccessLog.txt
    40073                Apr 23 15:41       11000_AccessLog_1.txt
    .
    .
    .
    .
        0                      Apr 24 00:00       AuditLog.txt
        0                      Apr 23 00:00       AuditLog_1.txt
                .
                .
                .
0                              Apr 18 00:00       AuditLog_6.txt
  6134109              Apr 24 13:37       ErrorLog.txt
20735156            Apr 23 23:04       ErrorLog_1.txt
19328645            Apr 22 13:51       ErrorLog_2.txt
    15949                Apr 21 11:08       ErrorLog_3.txt
  1104578              Apr 20 23:04       ErrorLog_4.txt
28477360            Apr 19 21:44       ErrorLog_5.txt
  1018162              Apr 18 14:12       ErrorLog_6.txt
19787299            Jul  6  2011           ErrorLog_7.txt


Also let me know how to split  my log file they are of approx 500 MB

They are with the default setting
System log file: notice
File log level: info
Rotate log file: daily
Keep log file: 7

~Gurbeer

________________________________

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.

________________________________

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.


________________________________

NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.
_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to