File Name in log file using log4php - log4php

I write a wrapper over log4php api named as loggerimplementation.php
Now I faced a problem in log files. When I called a function for logging defined in loggerimplementation.
Log file generated as:
2011-06-10 10:49:17 [INFO] Log4phpTest: Hello (at C:\xampp\htdocs\logger\Loggerimplementation.php line 74)
2011-06-10 10:50:08 [INFO] Log4phpTest: Hello (at C:\xampp\htdocs\logger\Loggerimplementation.php line 74)
2011-06-10 11:04:01 [INFO] Log4phpTest: Hello (at C:\xampp\htdocs\logger\Loggerimplementation.php line 78)
Now , as you can see %F will always show wrapper file name because it's always called from there. But I want real file name which one used this wrapper.
So please suggest me the way for this.
Or
tell me from where %F details I can get?
Waiting for reply.

Related

"No single root directory found, all dists must extract to a single directory" error when trying to upload module to zef via App::Mi6

Getting a weird error I've never seen before while trying to upload a new module to zef using the App::Mi6 mi6 release command:
==> Step 9. UploadToZef
Are you sure you want to upload Directory-0.0.1.tar.gz to Zef ecosystem? (y/N) y
Executing /Users/steve/.rakubrew/versions/moar-2022.12/bin/rakudo -e use Fez::CLI --file=Directory-0.0.1.tar.gz upload
>>= Looking in "Directory-0.0.1.tar.gz" for META6.json
=<< No single root directory found, all dists must extract to a single directory
Failed
in method upload at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/12D2D4FC78FDF40E8B7DEC72AF31ECED31A67D08 (App::Mi6::Fez) line 19
in method run at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/A4949DB54562D3B5154DD447B5CC2C730F09B0E5 (App::Mi6::Release::UploadToZef) line 24
in method run at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/BDF7095037EE976677901A8557FD533DCDC6FD65 (App::Mi6::Release) line 49
in method cmd at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/sources/299DED9746B9228495A0B5E829FE0A6BBD7DFE88 (App::Mi6) line 162
in sub MAIN at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/resources/5831540356728593B89C55370F0C33F8DD0813F5 line 20
in block <unit> at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/resources/5831540356728593B89C55370F0C33F8DD0813F5 line 5
in sub MAIN at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/bin/mi6 line 3
in block <unit> at /Users/steve/.rakubrew/versions/moar-2022.12/share/perl6/site/bin/mi6 line 1
Google turns up nothing on this error. This means I've found a major bug or the three glasses of wine I've had tonight have me doing something really stupid. :)
OK, this is a bug related to how the fez module interacts with how tarballs are generated on a mac.
A pull request has been made to address this issue: https://github.com/tony-o/raku-fez/pull/74.
I'm not sure what accounts for things working on 2022.07 and not 2022.12 version of raku.

Would you like to replace the existing file was asked while extracting selenium-server-standalone jar file

After having downloaded the selenium-server-standalone-3.141.59 jar file from https://www.selenium.dev/downloads/, I tried to extract the files. During the extraction, a pop-up shows up saying:
"The following file already exists. C:\Selenium3\selenium-server-standalone-3.141.59\META-INF\LICENSE.txt
Would you like to replace the existing file [file 1 with 11.969 bytes modified on 02/11/2014 19:52] with this one [file 2 with 36.116 bytes modified on 25/04/2013 16:52]"
I then get to choose from options like 'Yes', 'Yes to all', 'No', 'No to all' etc. Why is this happening? I was expecting a normal extraction in which all files are simply extracted and no questions asked about whether to replace certain files or not. Is there a bug with this jar file?
Please see attached screenshot.
I was able to reproduce the error...
while trying to extract the contents of selenium-server-standalone-3.141.59.jar.
Solution
If your usecase is to use selenium-server-standalone-3.141.59.jar within a Java project, instead of extracting the selenium-server-standalone-3.141.59.jar you need to add the jar file as an External JAR in the JAVA BUILD PATH for your project within the IDE as follows:

Testing net/http?

I am a little confused about how to structure a go web app and its tests. I have read the How to Write Go Code but still don't get it. For example, I have a go project called "beacon" with a beacon.go file at the root. Adding a trivial beacon_test.go file (copied verbatim from http://golang.org/pkg/net/http/httptest/#example_Server) causes this error:
$ go test
# github.com/jelder/beacon
./beacon_test.go:11: main redeclared in this block
previous declaration at ./beacon.go:216
FAIL github.com/jelder/beacon [build failed]
Sure enough, line 11 is func main(). If I instead change the package main line in my beacon_test.go to package hello, I get this error instead:
can't load package: package github.com/jelder/beacon: found packages main (beacon.go) and hello (beacon_test.go) in /Users/jacob/src/github.com/jelder/beacon
beacon_test.go has also a function called main() rename it to TestFirst (or any other name you like as long as it starts with Test, note the uppercase T is important). There is no need for that. Just run go test . from inside the package you are working on (the one containing the *.go files). Post the full files if you need more help.

Internal error while loading to Bigquery table

I ran this command to load 11 files to a Bigquery table:
bq load --project_id=ardent-course-601 --source_format=NEWLINE_DELIMITED_JSON dw_test.rome_defaults_20140819_test gs://sm-uk-hadoop/queries/logsToBq_transformLogs/rome_defaults/20140819/23af7218-617d-42e8-884e-f213a583094a/part* /opt/sm-analytics/projects/logsTobqMR/jsonschema/rome_defaultsSchema.txt
I got this error:
Waiting on bqjob_r46f38146351d545_00000147ef890755_1 ... (11s) Current status: DONE
BigQuery error in load operation: Error processing job 'ardent-course-601:bqjob_r46f38146351d545_00000147ef890755_1': Too many errors encountered. Limit is: 0.
Failure details:
- File: 5: Unexpected. Please try again.
I tried many times after that and still got the same error.
To debug what went wrong, I instead load each file one by one to the Bigquery table. For example:
/usr/local/bin/bq load --project_id=ardent-course-601 --source_format=NEWLINE_DELIMITED_JSON dw_test.rome_defaults_20140819_test gs://sm-uk-hadoop/queries/logsToBq_transformLogs/rome_defaults/20140819/23af7218-617d-42e8-884e-f213a583094a/part-m-00011.gz /opt/sm-analytics/projects/logsTobqMR/jsonschema/rome_defaultsSchema.txt
There are 11 files total and each ran fine.
Could someone please help? Is this a bug on Bigquery side?
Thank you.
There was an error reading one of the files: gs://...part-m-00005.gz
Looking at the import logs, it appears that the gzip reader encountered an error decompressing the file.
It looks like that file may not actually be compressed. BigQuery samples the header of the first file in the list to determine whether it is dealing with compressed or uncompressed files and to determine the compression type. When you import all of the files at once, it only samples the first file.
When you run the files individually, bigquery reads the header of the file and determines that it isn't actually compressed (despite having the suffix '.gz') so imports it as a normal flat file.
If you run a load that doesn't mix compressed and uncompressed files, it should work successfully.
Please let me know if you think this is not the case and I'll dig in some more.

What kind of info are there in the first 832 bytes of .so file?

I saw many similar stuff like this:
open("/lib64/libpthread.so.0", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\260W \0242\0\0\0"..., 832) = 832
What's there in the beginning 832 bytes?
If the listing above was captured at program startup, then it is
likely that you are seeing the runtime loader in action, as it brings
in shared libraries and resolves symbols prior to launching the
program.
As for the initial contents being read, every ELF file starts with an
ELF header which describes the layout and contents of the rest of the
file---please see the tutorial "libelf by Example" for more
information.