<tal:header replace="structure here/manage_page_header" />

<tal:tabs replace="structure here/manage_tabs" />

<main class="container-fluid">

<form class="form-horizontal" action="setProperties" method="post" tal:define="standard modules/Products.zms/standard;">

<p class="form-help">
This page lists the entries that have been logged in this Zope instance
recently. You can configure how many entries should be kept
and whether the entries should be copied to Zope's event log
file(s).
</p>

<div class="form-group row">
	<label class="col-sm-4 col-md-2 control-label" for="copy_to_stdout">
		Lines back in event log
	</label>
	<div class="col-md-10 col-sm-8">
		<input class="form-control" type="number" name="tail_event_log_linesback" tal:attributes="value python:getattr(here,'tail_event_log_linesback',100)"/>
	</div>
</div><!-- .form-group -->

<div class="form-group row">
	<label class="col-sm-4 col-md-2 control-label" for="copy_to_stdout">
		Copy entries to standard-out
	</label>
	<div class="col-md-10 col-sm-8">
		<div class="btn btn-light"><input type="checkbox" name="copy_to_stdout" value="copy_to_stdout" tal:attributes="checked python:['','checked'][int(getattr(here,'copy_to_stdout') in [1,True])]"/></div>
	</div>
</div><!-- .form-group -->

<div class="form-group row">
	<label class="col-sm-4 col-md-2 control-label" for="logged_entries:list">
		Logged entry types
	</label>
	<div class="col-md-10 col-sm-8">
		<select class="form-control" name="logged_entries:list" multiple="multiple" size="3">
		<tal:block tal:repeat="item python:['DEBUG','INFO','ERROR']">
			<option tal:attributes="value item; selected python:['','selected'][int(item in here.logged_entries)]" tal:content="item">the item</option>
		</tal:block>
		</select>
	</div>
</div><!-- .form-group -->

<div class="form-group row">
	<div class="col-12">
		<button name="submit" type="submit" class="btn btn-primary" value="Save Changes">Save Changes</button>
	</div>
</div><!-- .form-group -->

</form>


<div class="card mt-5">
	<div class="card-header">
		<tal:block tal:content="python:getattr(here,'tail_event_log_linesback',100)">###</tal:block> lines back in event log&nbsp;
		<a href="./getLOG" target="_blank" title="Download Log"><i class="fas fa-download text-primary"></i></a>
	</div>
	<div class="card-body zmi-traceback">
		<pre tal:content="python:'\n'.join(here.tail_event_log(linesback=int(getattr(here,'tail_event_log_linesback',100))))">the tail event-log</pre>
	</div>
</div>


</main>

<tal:footer replace="structure here/manage_page_footer" />