We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I am using MultiOutput to Log to multioutput location. Below is my code to Create logger
List<LogOutput> delegateList = List.empty(growable: true); for (var element in logUploadMechanism) { delegateList.add(getloggerDelegates(element)); } MultiOutput output = MultiOutput(delegateList); logger = Logger( printer: LoggerMessager(), output:output);
LogOutput getloggerDelegates(delegateName) { switch (delegateName.toLowerCase()) { case CONSTANT_STRING_CONSOLE: return ConsoleLoggerDelegate(); case CONSTANT_STRING_FILE: return FileLoggerDelegate(file: File("logs.txt")); case CONSTANT_STRING_AWS_FIREHOSE: return AWSFirehoseLoggerDelegate(); default: return ConsoleLoggerDelegate(); } }
created the custom output class for each output method. Here is my fileOutput class
class FileLoggerDelegate extends LogOutput { @override void output(OutputEvent event) { print("FileLoggerDelegate"); var filePath = 'logs.txt'; var file = File(filePath).openWrite(mode: FileMode.append); for (var line in event.lines) { file.writeln(line); } file.close(); } }
File is not creating and also logging is not happening. I have no clue what is going wrong. Suggestion would be helpful.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi
I am using MultiOutput to Log to multioutput location. Below is my code to Create logger
created the custom output class for each output method.
Here is my fileOutput class
File is not creating and also logging is not happening. I have no clue what is going wrong. Suggestion would be helpful.
The text was updated successfully, but these errors were encountered: