The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Logging operator executions
nico_timotius
Member Posts: 4 Contributor I
in Help
Hi RapidMiner Community,
I've managed to deploy my process into a web service using RapidMiner Server. I think it will be beneficial if the web service can have a log just like a log4j. I am thinking to create a log for the web service so it will show something like this
I think it will be helpful to solve issues found if the web service used in a production environment. I am aware there are log related operators such as Log, Log to Data but it can only manage to capture one information from an operator.
Do you have any suggestion of ways to achieve that kind of need?
Thank you
TN
I've managed to deploy my process into a web service using RapidMiner Server. I think it will be beneficial if the web service can have a log just like a log4j. I am thinking to create a log for the web service so it will show something like this
INFO [2019-03-29 14:55:56] Start A Prediction Process
INFO [2019-03-29 14:55:56] Input Data : {AAAA,BBBB}
INFO [2019-03-29 14:55:56] Preprocess the data
INFO [2019-03-29 14:55:59] Load Model
ERROR [2019-03-29 14:55:59] SomethingWrongWithTheModelException
INFO [2019-03-29 14:55:59] End A Prediction Process
Do you have any suggestion of ways to achieve that kind of need?
Thank you
TN
Tagged:
0
Best Answer
-
IngoRM Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University Professor Posts: 1,751 RM FounderHi,The process below shows an example about how to use both logging mechanisms. You can see the result if you activate the "Log" panel in the menu "View" - "Show Panel...". I also used some macros in those messages to demonstrate how to create those dynamically.The only thing I would like to add is that I personally would prefer
operator.getLogger().log(Level level, String text);
instead of the getLog() method Martin has mentioned. But both should work.Hope this helps,
Ingo<?xml version="1.0" encoding="UTF-8"?><process version="9.2.001"><br> <context><br> <input/><br> <output/><br> <macros/><br> </context><br> <operator activated="true" class="process" compatibility="9.2.001" expanded="true" name="Process"><br> <parameter key="logverbosity" value="init"/><br> <parameter key="random_seed" value="2001"/><br> <parameter key="send_mail" value="never"/><br> <parameter key="notification_email" value=""/><br> <parameter key="process_duration_for_mail" value="30"/><br> <parameter key="encoding" value="UTF-8"/><br> <process expanded="true"><br> <operator activated="true" class="retrieve" compatibility="9.2.001" expanded="true" height="68" name="Retrieve Golf" width="90" x="45" y="34"><br> <parameter key="repository_entry" value="//Samples/data/Golf"/><br> </operator><br> <operator activated="true" class="extract_macro" compatibility="9.2.001" expanded="true" height="68" name="Extract Macro" width="90" x="179" y="34"><br> <parameter key="macro" value="number_of_rows"/><br> <parameter key="macro_type" value="number_of_examples"/><br> <parameter key="statistics" value="average"/><br> <parameter key="attribute_name" value=""/><br> <list key="additional_macros"/><br> </operator><br> <operator activated="true" class="print_to_console" compatibility="9.2.001" expanded="true" height="82" name="Print to Console" width="90" x="313" y="34"><br> <parameter key="log_value" value="Number of rows is %{number_of_rows}"/><br> </operator><br> <operator activated="true" class="execute_script" compatibility="9.2.001" expanded="true" height="82" name="Execute Script" width="90" x="447" y="34"><br> <parameter key="script" value="import java.util.logging.Level; ExampleSet inputData = input[0]; operator.getLogger().log(Level.INFO, "Number of rows: " + %{number_of_rows}); return inputData;"/><br> <parameter key="standard_imports" value="true"/><br> </operator><br> <connect from_op="Retrieve Golf" from_port="output" to_op="Extract Macro" to_port="example set"/><br> <connect from_op="Extract Macro" from_port="example set" to_op="Print to Console" to_port="through 1"/><br> <connect from_op="Print to Console" from_port="through 1" to_op="Execute Script" to_port="input 1"/><br> <connect from_op="Execute Script" from_port="output 1" to_port="result 1"/><br> <portSpacing port="source_input 1" spacing="0"/><br> <portSpacing port="sink_result 1" spacing="0"/><br> <portSpacing port="sink_result 2" spacing="0"/><br> </process><br> </operator><br></process>
7
Answers
Best,
Martin
Dortmund, Germany
Thanks for the answer. I don't think i managed to use the mentioned operator properly. Is there any tutorial? I can't find the tutorial on the operator.
Best,
TN
Thanks for the help. What a great community
Best Regards,
TN