DonatShell
Server IP : 180.180.241.3  /  Your IP : 216.73.216.252
Web Server : Microsoft-IIS/7.5
System : Windows NT NETWORK-NHRC 6.1 build 7601 (Windows Server 2008 R2 Standard Edition Service Pack 1) i586
User : IUSR ( 0)
PHP Version : 5.3.28
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /Program Files (x86)/MySQL/MySQL Workbench 6.1 CE/modules/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /Program Files (x86)/MySQL/MySQL Workbench 6.1 CE/modules/wb_admin_logs.pyc

,2Sc@sdZddlmZmZmZmZmZddlZddlmZm	Z	ddl
mZmZm
Z
mZmZddlZddlmZmZmZmZmZddlmZddlmZmZd	ejfd
YZdejfdYZdS(
s
How to handle MySQL logs
*************************

Among other things this module needs to establish:

1. Which of the logs (if any) are enabled.
2. Whether the output of the enabled logs are stored in a table or in a log file.


Determining the state of the logs
-----------------------------------

There are two possible scenarios:

the server is down:
    In this case all logs are assumed to be **disabled** since the server won't
    be logging anything unless it's running.

the server is up:
    Starting with MySQL Server 5.1.29 the relevant server variables changed.
    This derives in two new scenarios:

    server version < 5.1.29:
        :general query log:
            The state of this log is reflected in the server variable ``log``
            which will be set to ``'OFF'`` if the log is disabled or to either
            ``'ON'`` or to ``'1'`` or to a file path if the log is enabled.

        :slow query log:
            Its state is reflected in the server variable ``log_slow_queries``
            which will be set to ``'OFF'`` if the log is disabled or to
            ``'ON'`` or to ``'1'``  if the log is enabled.

        :error log:
            Its state is reflected in the server variable ``log_error``
            which will be set to ``''`` (the empty string) if the log is disabled
            or to the path to the error log file if the log is enabled.

            .. note::

               The error logs are not going to be written to the error log file
               if the server was started with the ``--console`` command line
               option on Windows, even if ``log_error`` has a path set up. In
               this case error logs are written to stderr.

               It seems that there's no way to query the server to determine if
               this ``--console`` option is in place.

        .. note::

           The ``log_slow_queries`` and ``log`` variable were removed in MySQL
           Server 5.6.

    server version >= 5.1.29:
        :general query log:
            If enabled the ``general_log`` variable will be set to ``'ON'`` or
            to ``'1'``. Otherwise it will be set to ``'OFF'`` or to ``'0'``.

        :slow query log:
            If enabled the ``slow_query_log`` variable will be set to ``'ON'`` or
            to ``'1'``. Otherwise it will be set to ``'OFF'`` or to ``'0'``.

        :error log:
            Its state is reflected in the server variable ``log_error`` as
            explained for server version < 5.1.29.

    .. note::

       For MySQL Server versions >= 5.1.6, if the variable ``log_output``
       contains the value ``'NONE'``, the general query log and the slow
       query log will not record any new log entry.

       The general log can also be disabled by setting to ``'1'`` the session
       variable ``sql_log_off``.


Determining where the logs are being written
---------------------------------------------

Starting from MySQL Server 5.1.6 there's the possibility of sending the logs
from the general query log or from the slow query log to a server table instead
of to a log file. This is controlled by the value of the variable ``log_output``
which can be a combination of the values ``'FILE'`` (log into log files),
``'TABLE'`` (log into a server table) or ``'NONE'`` (don't log). If given, ``'NONE'``
takes precedence over the other values.

.. warning::

   For MySQL Server versions older than 5.1.29 there's no reliable way to know
   where the general and slow query logs are being written (if they are logged
   to a file). Their default values are ``$datadir + $hostname + '.log'`` and
   ``$datadir + $hostname + '-slow.log'``, respectively. This can be changed
   in the command line or in the configuration file and the real paths will not
   be exposed in any server variable.

Starting from MySQL Server 5.1.29 the paths to the general and slow query log
files are stored in the ``general_query_log_file`` and in the``slow_query_log_file``
variables, respectively. *The server creates the file in the data directory unless
an absolute path name is given to specify a different directory.*



Use cases for the server logs
---------------------------------

1. The server is running. All logs are enabled and WB can precisely determine their
   sources. Every log is shown in its corresponding tab.

2. The ``log_output`` server variable contains both ``'FILE'`` and ``'TABLE'``.
   WB will select on a per log basis which source should be chosen. Will select
   table logs if the server is local or if the server is remote and any of these
   happen:

   * Cannot reliably determine the paths to the log file.
   * The user running WB has no read permissions on the log file.
   * The log file does not exist.
   * The user explicitly requested to read from log table.

3. ``log_output`` contains ``'NONE'``. Nonetheless WB will check for log sources
   and will show them, alerting the user about log not being updated because of
   that. *What to do if there are log files and log tables available in this case?*

4. The server is logging to files and WB can precisely determine their paths but
   the log file is missing in the file system. The situation will be reported to
   the user (advising him to ``FLUSH LOGS`` or restart the server and start querying)
   The log will not be shown as long as this situation persists.

5. The server is logging to tables and the connection to the server is lost. If the
   server is also logging to files, and a log file exists in the file system, the
   log file will be shown and the user will be warned about this change.

6. The server is logging to files and WB cannot precisely determine the path to the
   log file (i.e. server version < 5.1.29). WB will try to get the path from these
   sources in this order:

   1. The server's configuration file.
   2. The default path assumed by the server when no log path is specified.

   If no such file is found in the file system the log will not be shown.

7. The user changed the source of a log or the path to a log file while WB was
   showing the previous source/path. WB will switch to the new source/path and will
   inform the user of the change.

8. [Postponed] The user clicks on a *Add new log* button. A dialog will be shown in
   which the user will select the type of log to be added (error, general or slow),
   the log source (a database table or a log file) and the name of the log table/file.
   A new tab showing the user selected log will be shown and will persist during the
   session or until the user clicks on the tab's *Close* button.
i(tnewBoxtnewLabeltnewTreeNodeViewt
newTabViewt	newButtonN(tnot_running_warning_labeltmake_panel_header(tGeneralQueryLogReadertSlowQueryLogReadertGeneralLogFileReadertSlowLogFileReadertErrorLogFileReader(tLogFileAccessErrort
ServerIOErrortOperationCancelledErrortInvalidPasswordErrortlog_error_decorator(tWorkerThreadHelper(t	log_errort	log_debugtLogViewcBseZdZdZedZdZdZdZd
dZ
dZdZd	Z
d
ZdZdZRS(s|
    Main front end view class for displaying log entries.

    Each page in the Tab View is an instance of this class.
    cGstt|jt|j|j||_||_||_d|_
d|_d|_d|_
d|_|jd|_dS(s
        The arguments following BackendLogReaderClass will be passed to
        BackendLogReaderClass to instantiate it in order to get a log
        reader object.
        N(tsuperRt__init__tFalsetset_managedtset_release_on_addtownertBackendLogReaderClasstargstNonet
log_readert	error_boxttreetbboxtwarning_boxt	update_uitworker(tselfRRR((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRs

								
cCs|jr%|j|jd|_ntt|_|jjdtt|}|jj|t	t	t
}|jd|jj|t	t	|j|j
|j|jt	tdS(Nis	Try again(RtremoveRRtTruetset_spacingRtstrtaddRRtset_texttadd_clicked_callbackR#(R%terrorterror_labelttry_again_button((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt_show_errors		
c
Cs|jr%|j|jd|_n|jrJ|j|jd|_n|jro|j|jd|_n|jr|j|jd|_n|jd|jdy|j|j	|_
WnAttt
tttfk
r
}td||j|dSX|j
jrwtt|_|jjdt|j
j}|jj|tt|j|jttnttj|_|jjtjx8|j
jD]*}|jjtj |d|dtqW|jj!|j|jtttj"}|j#d|j$d|j%d|j&d|jtdddddtj'|j
j(rt|j
j(j)}ntd}|j*tj+|j|ddddtj'tj,B|jtd	dd
ddtj't|j
j(rdnd|_-|j-j*tj+|j|j-d
dddtj'tj,B|jtd
ddddtj'td|_.|j.j*tj+|j|j.ddddtj'|j|tttt|_|jjd|j/|jtttj0|_1|j1j2d|j3d|j1j2d|j4d|jj5|j1|jjtdttt6|_7|j7j8d|jj|j7tt|j7j9|j:t6|_;|j;j8d|jj|j;tt|j;j9|j<t6|_=|j=j8d|jj|j=tt|j=j9|j>t6|_?|j?j8d|jj|j?tt|j?j9|j@t6|_A|jAj8d|jj|jAtt|jAj9|jBdS(Nis"Exception creating log reader: %s
iiiisLog File Location:tTABLEsLog File Size:is
retrieving...t-sShowing:sretrieving data...tCopytcopy_recordsCopy Detailstcopy_detailsttOldests< Previous PagesNext Page >sMost RecenttRefresh(CRR&RR R!R"tset_paddingR(RRRR
RRRtIOErrort
ValueErrorRR0tpartial_supportRR'RR*RRtmformstTreeFlatListtset_selection_modetTreeSelectMultipletcolumn_specst
add_columntStringColumnTypetend_columnstnewTabletset_row_spacingtset_column_spacingtset_column_countt
set_row_countt	HFillFlagtlog_filetpatht	set_stylet	BoldStyletHExpandFlagt
size_labeltrange_labeltadd_endtnewContextMenut_menutadd_item_with_titleR4R5tset_context_menuRt
bof_buttonR+R,tgo_boftback_buttontgo_backtnext_buttontgo_nextt
eof_buttontgo_eoftrefresh_buttontrefresh(R%R-t
warning_labeltcolspecttabletlabel((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR#s				

!





%&%!)%"cCs||jjdS(N(Rtcurrent(R%tout((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytread_data_workerNscCs|j|d|_dS(N(R`RR$(R%tdata((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pythandle_worker_dataQs
cCs|jry|jj|dkr|js|jjt|jjt|jjt|j	jt|j
jtt|j|j
|_|jjdndS|jjxP|D]H}|jj}x0t|D]"\}}|j||jqWqW|jj|jj|jj|jj|jj|jj|jj|jj|jj|jj|j	j|jj|j
jtWqtttt t!t"t#fk
r}|j$|qXndS(Ni(%RR`RR$RWtset_enabledRRYR]R[R_RRgRitstartR tcleartadd_nodet	enumeratet
set_stringtstripRQR+t
range_textRPt	size_textthas_previousthas_nextR'R
tRuntimeErrorRRRR:R;R0(R%trecordstrectrowtidxtcolR-((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR`Us6	
	

$cCs|jj}djg|jjD]}|d^q"g}xc|D][}g}x6tt|jjD]}|j|j|qjW|jdj|qEW|rt	j
jdj|ndS(Ns, is
(R t
get_selectiontjoinRRAtrangetlentappendt
get_stringR=t	Utilitiestset_clipboard_text(R%t	selectiontrttexttnodetrecordti((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR4us/
cCsh|jj}g}x*|D]"}|j|j|jjqW|rdtjjdj	|ndS(Ns
(
R R{RRRt
detail_columnR=RRR|(R%RRR((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR5s
 cCsVy|j|jjWn5ttttttt	fk
rQ}|j
|nXdS(N(R`RtfirstR
RuRRRR:R;R0(R%R-((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRXs$cCsVy|j|jjWn5ttttttt	fk
rQ}|j
|nXdS(N(R`RtlastR
RuRRRR:R;R0(R%R-((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR^s$cCsqy5|jjr!|jjnd}|j|Wn5ttttt	t
tfk
rl}|j|nXdS(N(
RRstpreviousRR`R
RuRRRR:R;R0(R%RvR-((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRZs
$$cCsqy5|jjr!|jjnd}|j|Wn5ttttt	t
tfk
rl}|j|nXdS(N(
RRttnextRR`R
RuRRRR:R;R0(R%RvR-((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR\s
$$N(t__name__t
__module__t__doc__RRR0R#RgRiRR`R4R5RXR^RZR\(((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRs		l		 						tWbAdminLogscBseZeZedZedZdZdZdZ	dZ
dZdZdZ
d	Zd
ZdZdZRS(
cCs|j|ddtdS(Ntwba_instancesServer Logs(t
register_pageR'(tclst
admin_context((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytwba_registerscCsdS(Ntadmin_server_logs((R((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt
identifierscCsHtt|jt|j||_||_||_t|_dS(N(	RRRRRtctrl_betserver_profilet	main_viewtdisable_log_refresh(R%RRR((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRs
			cCs|jd|jdtd|jjd|_|j|jttt	|_
|j|j
tt|j
jttt|_
|j|j
ttd|_d|_d|_d|_d|_dS(Niistitle_logs.pngsServer Logs(R9R(RRtnametheadingR*RR'RtwarningtshowRttabViewRtgeneral_log_tabtslow_log_tabtgeneral_file_log_tabtslow_file_log_tabterror_file_log_tab(R%((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt	create_uis

				csi}jjrjjjdddsy&jjd}|jsU|SWn|SX|jddkr|dndj_t	d	j
jjjfqy&jjd
}|js|SWn|SX|jdj_djjkrdjjkrfd}jjsbd|d
<d|d<t	d	j
j|f|St
ddsjjry<jjrtjjn|jjd|d
<Wqd|d
<qXn
d|d
<|d
_n
j|d
<t
ddsjjrky<jjr9tjjn|jjd|d<Wqud|d<quXn
d|d<|d_qj|d<nt	d	j
j|fn|S(NiiisSHOW VARIABLES LIKE 'log'tValuetONtFILEtNONEs%s: log_output = %s
s SHOW VARIABLES LIKE 'log_output'R1cs{ddl}ddl}|j}|jj|jj|jj}|jsjt	dn|j
|dS(NiR6(twb_admin_sshtwb_server_controlt
WbAdminSSHtwrapped_connectRtPasswordHandlertclientt	open_sftptis_connectedR:topen(RLRRtsshtsftp(R%(sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytopen_remote_filestgeneral_logtslow_logt stored_general_log_source_choicetstored_slow_log_source_choice(Rtis_sql_connectedttarget_versiont#is_supported_mysql_version_at_leastt
exec_querytnextRowtstringByNameRt
log_outputRt	__class__Rt
admin_enabledtgetattrRtgeneral_log_file_pathtis_localRRtslow_log_file_pathR(R%tdesttresultR((R%sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytget_log_destinations^'#$


.

.
cCs4|jj||jjt|jjtdS(N(RR+RR'RR(R%tmsg((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytshow_message_panelscGsRd|kr%t|ddg}nd|krJt|ddg}nd|kr~|jr~|jj|jd|_nd|kr|jr|jj|jd|_nd|kr|jr|jj|jd|_nd|kr|jr|jj|jd|_nd|krN|jrN|jj|jd|_ndS(NR1tgeneral_tabtslow_tabRtgeneral_file_tabt
slow_file_tabterror_file_tab(	tlistRRtremove_pageRRRRR(R%tsource((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt_remove_tabss&cGsd|kr%t|ddg}nd|krJt|ddg}nd|kr|jjr|jry;t|t|j|jj|_|jj|jdWqt	k
r|j
d	|jjd|_qXnd|kr~|jjr~|jj
r~|jr~y;t|t|j|jj
|_|jj|jd
Wq~t	k
rz|j
d|jj
d|_q~Xnd|kr|jjr|jjr|jry;t|t|j|jj|_|jj|jdWqt	k
r|j
d	|jjd|_qXnd|krq|jjrq|jrqt|t|j|_|jj|jd
nd|kr|jjr|jrt|t|j|_|jj|jdndS(NR1RRRRRRsError Log FilesYThere was a problem reading %s. Please verify that you have read permissions on that filesGeneral Log FilesYThere was a problem reading %s.
Please verify that you have read permissions on that files
Slow Log FilesGeneral Log TablesSlow Query Log Table(RRterror_log_file_pathRRRRRtadd_pageR:RRtgeneral_log_enabledRRR	tslow_log_enabledRRR
RRRR(R%R((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt	_add_tabs*s>"!
.!
.!
""cCs|j}|jd|jjs4d|j_nd|jjkrY|jddnX|jjdkr|jd|jdn)|jjdkr|jd|jdn|jjdks|jjdkrtddd	d
g}g}|jjsd	d
g}nF|j|ddkr3d	nd|j|ddkrVd
nd|jt	|t||jt	|n!d
|jj}|j
|dS|jjt
|jjtdS(NRs
TABLE,FILERR1Rs
FILE,TABLERRRRRRsWe have detected a problem in your current Log Destination.
It is set to %s. Please refer to the documentation for further information:
http://dev.mysql.com/doc/refman/5.1/en/log-destinations.html(RRRRRtsetRRRttupleRRRRRR'(R%Rttabstto_be_addedR((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR#Rs4


$##
cCs|js)|j|jt|_n|jy|jWnPtk
r}tjj	dd|ddd}|tj
krt|_qnXdS(NsLog Refreshs8An error occurred while displaying MySQL server logs: %stIgnoretCancelR6(t
ui_createdtdetect_pathsRR'R#R`t	ExceptionR=Rtshow_warningtResultCancelR(R%teR((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pytpage_activatedzs	


"cCs|jjdd}|dkrt|jj|jj|jj|jjgrtj	|j|j}|j
|jjdtt
|j|jj}|jjr|jdr|d|j_n|jjs2|jdr|dn|jdr|dnd	}|r2|jd
|j_q2n|jjs|jdrW|dn|jdrp|dnd	}|r|jd
|j_qn|jjr|jd
r|d
jd
|j_qndS(Ntverboseitstoppedtunknowntwarn_missings
log-outputtgeneral_log_filetlogR6t"tslow_query_log_fileslog-slow-queriess	log-error(sstoppedsunknown(Rtis_server_runningtallRRRRRtwb_admin_config_file_betWbAdminConfigFileBEtopen_configuration_filetconfig_file_pathRtdicttget_optionstconfig_file_sectionthas_keyt	log_ouputRp(R%tstatustcfg_betoptionsRL((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRs.			cCs|jr
dS|jjrQ|jr5|jjn|jrQ|jjqQn|jrj|jjn|jr|jjn|jr|jjndS(N(	RRRRR`RRRR(R%((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyR`s						cCsdS(N((R%((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt
do_refreshs(RRRRtclassmethodRRRRRRRRR#RRR`R(((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyRs			C			(	(		 	(RR=RRRRRtwb_admin_utilsRRt
wb_log_readerRRR	R
RRt	wb_commonRR
RRRtworkbench.utilsRt
workbench.logRRtBoxRR(((sLC:\Program Files (x86)\MySQL\MySQL Workbench 6.1 CE\modules\wb_admin_logs.pyt<module>s(((

Anon7 - 2022
AnonSec Team