1

I try to run this code:

#!/usr/bin/perl -w
use strict;
use warnings;
use FCGI;

my $request = FCGI::Request();

my $count = 0;
while ($request->Accept() >= 0) {
    # Handle each request
    my $content = "Content-type: text/html\r\n\r\n";
    $content .= "Hello, World from Perl FastCGI!\n";

    print STDERR "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque varius lorem leo, eget mollis est consequat eu. Quisque metus risus, posuere ut eleifend quis, porttitor id nisl. Donec a turpis sed augue blandit vehicula. Cras ligula diam, facilisis at suscipit eu, tempor quis lectus. Fusce auctor tellus risus. Sed rhoncus rhoncus tempus. Maecenas vel varius justo. Morbi sit amet dignissim nisl. Nulla tincidunt risus varius interdum vehicula. Pellentesque ut imperdiet massa, non sodales quam.\n";
    print STDERR "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque varius lorem leo, eget mollis est consequat eu. Quisque metus risus, posuere ut eleifend quis, porttitor id nisl. Donec a turpis sed augue blandit vehicula. Cras ligula diam, facilisis at suscipit eu, tempor quis lectus. Fusce auctor tellus risus. Sed rhoncus rhoncus tempus. Maecenas vel varius justo. Morbi sit amet dignissim nisl. Nulla tincidunt risus varius interdum vehicula. Pellentesque ut imperdiet massa, non sodales quam.\n";

    # Print the response
    print $content;
}

$request->Finish();  # Finish the request

I have problem with logs from Apach2. Why are log messages splitted?

pmw-enduser-test  | [Mon Jun 17 17:58:07.643922 2024] [core:notice] [pid 1] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
pmw-enduser-test  | [Mon Jun 17 17:58:09.268842 2024] [fcgid:warn] [pid 8] [client 192.168.65.1:22489] mod_fcgid: stderr: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque varius lorem leo, eget mollis est consequat eu. Quisque metus risus, posuere ut eleifend quis, porttitor id nisl. Donec a turpis sed augue blandit vehicula. Cras ligula diam, facilisis at suscipit eu, tempor quis lectus. Fusce auctor tellus risus. Sed rhoncus rhoncus tempus. Maecenas vel varius justo. Morbi sit amet dignissim nisl. Nulla tincidunt risus varius interdum vehicula. Pellentesque ut imperdiet massa, non sodales quam.
pmw-enduser-test  | [Mon Jun 17 17:58:09.268932 2024] [fcgid:warn] [pid 8] [client 192.168.65.1:22489] mod_fcgid: stderr: Lorem
pmw-enduser-test  | [Mon Jun 17 17:58:09.268941 2024] [fcgid:warn] [pid 8] [client 192.168.65.1:22489] mod_fcgid: stderr: ipsum dolor sit amet, consectetur adipiscing elit. Quisque varius lorem leo, eget mollis est consequat eu. Quisque metus risus, posuere ut eleifend quis, porttitor id nisl. Donec a turpis sed augue blandit vehicula. Cras ligula diam, facilisis at suscipit eu, tempor quis lectus. Fusce auctor tellus risus. Sed rhoncus rhoncus tempus. Maecenas vel varius justo. Morbi sit amet dignissim nisl. Nulla tincidunt risus varius interdum vehicula. Pellentesque ut imperdiet massa, non sodales quam.
pmw-enduser-test  | 192.168.65.1 - - [17/Jun/2024:17:58:09 +0200] "GET /pmweu-rest/pub/p234/selfCheck?a=b&c=d&e=f HTTP/1.1" 200 32 "-" "PostmanRuntime/7.39.0"

I expected apache2 to print only two log messages but not three log messages. This is problem if i want to change format to JSON.

0

You must log in to answer this question.

Browse other questions tagged .